Commit cc13864dfb

Robin Voetter <robin@voetter.nl>
2023-09-16 01:02:31
spirv: lower enum_tag constants
1 parent aeaaa95
Changed files (1)
src
codegen
src/codegen/spirv.zig
@@ -1146,6 +1146,11 @@ pub const DeclGen = struct {
                 });
                 return result_id;
             },
+            .enum_tag => {
+                const int_val = try val.intFromEnum(ty, mod);
+                const int_ty = ty.intTagType(mod);
+                return try self.constant(int_ty, int_val, repr);
+            },
             // TODO: We can handle most pointers here (decl refs etc), because now they emit an extra
             // OpVariable that is not really required.
             else => {