spirv: put global var initializers in functions
This commit is contained in:
committed by
Andrew Kelley
parent
240f9d740d
commit
b30cd67987
@@ -174,6 +174,9 @@ globals: struct {
|
||||
section: Section = .{},
|
||||
} = .{},
|
||||
|
||||
/// The function IDs of global variable initializers
|
||||
initializers: std.ArrayListUnmanaged(IdRef) = .{},
|
||||
|
||||
pub fn init(gpa: Allocator, arena: Allocator) Module {
|
||||
return .{
|
||||
.gpa = gpa,
|
||||
@@ -202,6 +205,8 @@ pub fn deinit(self: *Module) void {
|
||||
self.globals.globals.deinit(self.gpa);
|
||||
self.globals.section.deinit(self.gpa);
|
||||
|
||||
self.initializers.deinit(self.gpa);
|
||||
|
||||
self.* = undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user