aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv/Module.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/spirv/Module.zig')
-rw-r--r--src/codegen/spirv/Module.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig
index d53dcb4368..9d8cca9445 100644
--- a/src/codegen/spirv/Module.zig
+++ b/src/codegen/spirv/Module.zig
@@ -246,10 +246,10 @@ fn orderGlobalsInto(
const global = self.globalPtr(decl_index).?;
const insts = self.globals.section.instructions.items[global.begin_inst..global.end_inst];
- seen.set(@enumToInt(decl_index));
+ seen.set(@intFromEnum(decl_index));
for (deps) |dep| {
- if (!seen.isSet(@enumToInt(dep))) {
+ if (!seen.isSet(@intFromEnum(dep))) {
try self.orderGlobalsInto(dep, section, seen);
}
}
@@ -267,7 +267,7 @@ fn orderGlobals(self: *Module) !Section {
errdefer ordered_globals.deinit(self.gpa);
for (globals) |decl_index| {
- if (!seen.isSet(@enumToInt(decl_index))) {
+ if (!seen.isSet(@intFromEnum(decl_index))) {
try self.orderGlobalsInto(decl_index, &ordered_globals, &seen);
}
}
@@ -284,14 +284,14 @@ fn addEntryPointDeps(
const decl = self.declPtr(decl_index);
const deps = self.decl_deps.items[decl.begin_dep..decl.end_dep];
- seen.set(@enumToInt(decl_index));
+ seen.set(@intFromEnum(decl_index));
if (self.globalPtr(decl_index)) |global| {
try interface.append(global.result_id);
}
for (deps) |dep| {
- if (!seen.isSet(@enumToInt(dep))) {
+ if (!seen.isSet(@intFromEnum(dep))) {
try self.addEntryPointDeps(dep, seen, interface);
}
}
@@ -516,7 +516,7 @@ pub fn allocDecl(self: *Module, kind: DeclKind) !Decl.Index {
.begin_dep = undefined,
.end_dep = undefined,
});
- const index = @intToEnum(Decl.Index, @intCast(u32, self.decls.items.len - 1));
+ const index = @enumFromInt(Decl.Index, @intCast(u32, self.decls.items.len - 1));
switch (kind) {
.func => {},
// If the decl represents a global, also allocate a global node.
@@ -531,7 +531,7 @@ pub fn allocDecl(self: *Module, kind: DeclKind) !Decl.Index {
}
pub fn declPtr(self: *Module, index: Decl.Index) *Decl {
- return &self.decls.items[@enumToInt(index)];
+ return &self.decls.items[@intFromEnum(index)];
}
pub fn globalPtr(self: *Module, index: Decl.Index) ?*Global {