diff options
| author | Robin Voetter <robin@voetter.nl> | 2023-04-08 15:05:29 +0200 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2023-04-09 01:51:54 +0200 |
| commit | fe0fb93fa04bf4767058cc7046100f3c4f33b3d4 (patch) | |
| tree | abc1b0b76b712a7cf58935179d5bd5fbc3de6349 /src/codegen | |
| parent | 1de2d2ee1c70dfd01dc8b161af53ce188e84b1d0 (diff) | |
| download | zig-fe0fb93fa04bf4767058cc7046100f3c4f33b3d4.tar.gz zig-fe0fb93fa04bf4767058cc7046100f3c4f33b3d4.zip | |
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.
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/spirv/Assembler.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/codegen/spirv/Assembler.zig b/src/codegen/spirv/Assembler.zig index ffb5503afc..fcfdbf56ee 100644 --- a/src/codegen/spirv/Assembler.zig +++ b/src/codegen/spirv/Assembler.zig @@ -444,8 +444,12 @@ fn processGenericInstruction(self: *Assembler) !?AsmValue { .OpExecutionMode, .OpExecutionModeId => &self.spv.sections.execution_modes, .OpVariable => switch (@intToEnum(spec.StorageClass, operands[2].value)) { .Function => &self.func.prologue, - // TODO: Emit a decl dependency - else => &self.spv.sections.types_globals_constants, + else => { + // This is currently disabled because global variables are required to be + // emitted in the proper order, and this should be honored in inline assembly + // as well. + return self.todo("global variables", .{}); + }, }, // Default case - to be worked out further. else => &self.func.body, |
