aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv/Module.zig
diff options
context:
space:
mode:
authorAli Cheraghi <alichraghi@proton.me>2024-11-01 02:03:33 +0330
committerAli Cheraghi <alichraghi@proton.me>2024-11-01 02:03:33 +0330
commita1cb9563f6a421220f87692f16251f3628c8cf6c (patch)
treef497b95e06f0b8f082960cd4af696bf2f5f52d15 /src/codegen/spirv/Module.zig
parent17a87d734167b500761ef0d61493342dea0ae01d (diff)
downloadzig-a1cb9563f6a421220f87692f16251f3628c8cf6c.tar.gz
zig-a1cb9563f6a421220f87692f16251f3628c8cf6c.zip
spirv: Uniform/PushConstant variables
- Rename GPU address spaces to match with SPIR-V spec. - Emit `Block` Decoration for Uniform/PushConstant variables. - Don't emit `OpTypeForwardPointer` for non-opencl targets. (there's still a false-positive about recursive structs) Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
Diffstat (limited to 'src/codegen/spirv/Module.zig')
-rw-r--r--src/codegen/spirv/Module.zig6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig
index 94787e06b9..f4af74b3aa 100644
--- a/src/codegen/spirv/Module.zig
+++ b/src/codegen/spirv/Module.zig
@@ -402,9 +402,7 @@ pub fn resolveString(self: *Module, string: []const u8) !IdRef {
return id;
}
-pub fn structType(self: *Module, types: []const IdRef, maybe_names: ?[]const []const u8) !IdRef {
- const result_id = self.allocId();
-
+pub fn structType(self: *Module, result_id: IdResult, types: []const IdRef, maybe_names: ?[]const []const u8) !void {
try self.sections.types_globals_constants.emit(self.gpa, .OpTypeStruct, .{
.id_result = result_id,
.id_ref = types,
@@ -416,8 +414,6 @@ pub fn structType(self: *Module, types: []const IdRef, maybe_names: ?[]const []c
try self.memberDebugName(result_id, @intCast(i), name);
}
}
-
- return result_id;
}
pub fn boolType(self: *Module) !IdRef {