adding decoration members propagation
Build / build (push) Successful in 1m40s
Test / build (push) Successful in 7m45s

This commit is contained in:
2026-04-27 15:42:29 +02:00
parent 5b7380eea0
commit 9cdb683f3f
4 changed files with 220 additions and 33 deletions
+14 -1
View File
@@ -201,6 +201,8 @@ pub const VariantData = union(Variant) {
},
AccessChain: struct {
target: SpvWord,
base: SpvWord,
indexes: []SpvWord,
value: Value,
},
FunctionParameter: struct {
@@ -247,7 +249,10 @@ pub fn deinit(self: *Self, allocator: std.mem.Allocator) void {
},
.Constant => |*c| c.value.deinit(allocator),
.Variable => |*v| v.value.deinit(allocator),
.AccessChain => |*a| a.value.deinit(allocator),
.AccessChain => |*a| {
allocator.free(a.indexes);
a.value.deinit(allocator);
},
.Function => |f| allocator.free(f.params),
else => {},
}
@@ -363,6 +368,14 @@ pub fn dupe(self: *const Self, allocator: std.mem.Allocator) RuntimeError!Self {
.params = allocator.dupe(SpvWord, f.params) catch return RuntimeError.OutOfMemory,
},
},
.AccessChain => |a| break :blk .{
.AccessChain = .{
.target = a.target,
.base = a.base,
.indexes = allocator.dupe(SpvWord, a.indexes) catch return RuntimeError.OutOfMemory,
.value = try a.value.dupe(allocator),
},
},
else => break :blk variant,
}
}