spirv: switch_br lowering

Implements lowering switch statements in the SPIR-V backend.
This commit is contained in:
Robin Voetter
2022-11-27 16:22:01 +01:00
parent 205d928b24
commit e443b1bed7
2 changed files with 122 additions and 0 deletions

View File

@@ -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;
}