diff options
| author | Robin Voetter <robin@voetter.nl> | 2022-11-27 16:22:01 +0100 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2023-04-09 01:51:50 +0200 |
| commit | e443b1bed7ccce45bf039a304fa8fa271f1faa0b (patch) | |
| tree | 951e6558d8bdfdc6a2b85b5e3e654abdf9e9838d /src/codegen/spirv/Module.zig | |
| parent | 205d928b24d46fd1fd5798c5d66e66ef25aa013f (diff) | |
| download | zig-e443b1bed7ccce45bf039a304fa8fa271f1faa0b.tar.gz zig-e443b1bed7ccce45bf039a304fa8fa271f1faa0b.zip | |
spirv: switch_br lowering
Implements lowering switch statements in the SPIR-V backend.
Diffstat (limited to 'src/codegen/spirv/Module.zig')
| -rw-r--r-- | src/codegen/spirv/Module.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig index f6c4cd735e..ab9d0588ca 100644 --- a/src/codegen/spirv/Module.zig +++ b/src/codegen/spirv/Module.zig @@ -132,6 +132,11 @@ pub fn allocId(self: *Module) spec.IdResult { return .{ .id = self.next_result_id }; } +pub fn allocIds(self: *Module, n: u32) spec.IdResult { + defer self.next_result_id += n; + return .{ .id = self.next_result_id }; +} + pub fn idBound(self: Module) Word { return self.next_result_id; } |
