aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2023-11-21 19:58:29 +0100
committerRobin Voetter <robin@voetter.nl>2023-11-24 01:11:15 +0100
commitcb026c5d599dddc38f34ee93438d52bbffe2f6ad (patch)
tree75bf3c0edeac952b30eaac1dc4a4ef1d579824f4 /src/codegen
parent255737ea572f437afb1f2ad67096d3a157d79d70 (diff)
downloadzig-cb026c5d599dddc38f34ee93438d52bbffe2f6ad.tar.gz
zig-cb026c5d599dddc38f34ee93438d52bbffe2f6ad.zip
spirv: always emit mask constants even if no bits are set
A parameter like this is not always optional, even if that is usually implied. SPIR-V tools fail to parse a module with an OpLoopMerge instruction where the loop control parameter is left out.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/spirv/Section.zig7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/codegen/spirv/Section.zig b/src/codegen/spirv/Section.zig
index ae88dc7c8a..f569512fdd 100644
--- a/src/codegen/spirv/Section.zig
+++ b/src/codegen/spirv/Section.zig
@@ -198,10 +198,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 +300,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.
}