authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2023-04-08 15:05:29+02:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2023-04-09 01:51:54+02:00
logfe0fb93fa04bf4767058cc7046100f3c4f33b3d4
treeabc1b0b76b712a7cf58935179d5bd5fbc3de6349
parent1de2d2ee1c70dfd01dc8b161af53ce188e84b1d0
signaturelock-open Commit is signed but in an unrecognized format.

spirv: deny global OpVariable in inline asm

This feature requires to be integrated with the mechanism that orders the global variables, and that is not yet in place.

1 files changed, 6 insertions(+), 2 deletions(-)

src/codegen/spirv/Assembler.zig+6-2
...@@ -444,8 +444,12 @@ fn processGenericInstruction(self: *Assembler) !?AsmValue {...@@ -444,8 +444,12 @@ fn processGenericInstruction(self: *Assembler) !?AsmValue {
444 .OpExecutionMode, .OpExecutionModeId => &self.spv.sections.execution_modes,444 .OpExecutionMode, .OpExecutionModeId => &self.spv.sections.execution_modes,
445 .OpVariable => switch (@intToEnum(spec.StorageClass, operands[2].value)) {445 .OpVariable => switch (@intToEnum(spec.StorageClass, operands[2].value)) {
446 .Function => &self.func.prologue,446 .Function => &self.func.prologue,
447 // TODO: Emit a decl dependency447 else => {
448 else => &self.spv.sections.types_globals_constants,448 // This is currently disabled because global variables are required to be
449 // emitted in the proper order, and this should be honored in inline assembly
450 // as well.
451 return self.todo("global variables", .{});
452 },
449 },453 },
450 // Default case - to be worked out further.454 // Default case - to be worked out further.
451 else => &self.func.body,455 else => &self.func.body,