aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/spirv')
-rw-r--r--src/codegen/spirv/Module.zig1
-rw-r--r--src/codegen/spirv/Section.zig17
2 files changed, 11 insertions, 7 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig
index 4ecbc8d7a0..056792ab9a 100644
--- a/src/codegen/spirv/Module.zig
+++ b/src/codegen/spirv/Module.zig
@@ -184,6 +184,7 @@ pub fn deinit(self: *Module) void {
self.sections.debug_strings.deinit(self.gpa);
self.sections.debug_names.deinit(self.gpa);
self.sections.annotations.deinit(self.gpa);
+ self.sections.types_globals_constants.deinit(self.gpa);
self.sections.functions.deinit(self.gpa);
self.source_file_names.deinit(self.gpa);
diff --git a/src/codegen/spirv/Section.zig b/src/codegen/spirv/Section.zig
index ae88dc7c8a..2ce11111a7 100644
--- a/src/codegen/spirv/Section.zig
+++ b/src/codegen/spirv/Section.zig
@@ -65,6 +65,16 @@ pub fn emit(
section.writeOperands(opcode.Operands(), operands);
}
+pub fn emitBranch(
+ section: *Section,
+ allocator: Allocator,
+ target_label: spec.IdRef,
+) !void {
+ try section.emit(allocator, .OpBranch, .{
+ .target_label = target_label,
+ });
+}
+
pub fn emitSpecConstantOp(
section: *Section,
allocator: Allocator,
@@ -198,10 +208,6 @@ fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand
}
}
- if (mask == 0) {
- return;
- }
-
section.writeWord(mask);
inline for (@typeInfo(Operand).Struct.fields) |field| {
@@ -304,9 +310,6 @@ fn extendedMaskSize(comptime Operand: type, operand: Operand) usize {
else => unreachable,
}
}
- if (!any_set) {
- return 0;
- }
return total + 1; // Add one for the mask itself.
}