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>
This commit is contained in:
Ali Cheraghi
2024-11-01 02:03:33 +03:30
parent 17a87d7341
commit a1cb9563f6
7 changed files with 55 additions and 35 deletions

View File

@@ -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 {