diff options
| author | Robin Voetter <robin@voetter.nl> | 2023-09-18 22:39:44 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-09-23 12:36:56 -0700 |
| commit | b845c9d5326bc83691edcb483ac44793b88afe75 (patch) | |
| tree | a965db64c6d8a6c657d46ab9983cdf88fb0c853f /src/codegen/spirv.zig | |
| parent | 5d844faf7c5c30555664b4161e5f9a903daaf562 (diff) | |
| download | zig-b845c9d5326bc83691edcb483ac44793b88afe75.tar.gz zig-b845c9d5326bc83691edcb483ac44793b88afe75.zip | |
spirv: generate module initializer
Diffstat (limited to 'src/codegen/spirv.zig')
| -rw-r--r-- | src/codegen/spirv.zig | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index e4ce3e5f3f..9d44b8eb8f 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -1494,7 +1494,6 @@ pub const DeclGen = struct { .id_result = decl_id, .storage_class = actual_storage_class, }); - self.spv.globalPtr(spv_decl_index).?.result_id = decl_id; // Now emit the instructions that initialize the variable. const initializer_id = self.spv.allocId(); @@ -1517,14 +1516,12 @@ pub const DeclGen = struct { }); // TODO: We should be able to get rid of this by now... - self.spv.endGlobal(spv_decl_index, begin); + self.spv.endGlobal(spv_decl_index, begin, decl_id, initializer_id); try self.func.body.emit(self.spv.gpa, .OpReturn, {}); try self.func.body.emit(self.spv.gpa, .OpFunctionEnd, {}); try self.spv.addFunction(spv_decl_index, self.func); - try self.spv.initializers.append(self.spv.gpa, initializer_id); - const fqn = ip.stringToSlice(try decl.getFullyQualifiedName(self.module)); try self.spv.sections.debug_names.emit(self.gpa, .OpName, .{ .target = decl_id, |
