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.
This commit is contained in:
Robin Voetter 2023-11-21 19:58:29 +01:00
parent 255737ea57
commit cb026c5d59
No known key found for this signature in database

View File

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