adding decoration members propagation
This commit is contained in:
+14
-1
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user