spirv: make IdResultType and IdRef weak aliases of IdResult

Previously they were strong aliases, but as these types are used quite
intermittendly it resulted in a lot of toRef() calls. Removing them
improves readability a bit.
This commit is contained in:
Robin Voetter
2022-11-28 19:14:16 +01:00
parent 0c2526b18e
commit 700dee34d5
6 changed files with 73 additions and 95 deletions

View File

@@ -80,22 +80,11 @@ fn render(writer: anytype, allocator: Allocator, registry: g.CoreRegistry) !void
\\const Version = @import("std").builtin.Version;
\\
\\pub const Word = u32;
\\pub const IdResultType = struct{
\\ id: Word,
\\ pub fn toRef(self: IdResultType) IdRef {
\\ return .{.id = self.id};
\\ }
\\};
\\pub const IdResult = struct{
\\ id: Word,
\\ pub fn toRef(self: IdResult) IdRef {
\\ return .{.id = self.id};
\\ }
\\ pub fn toResultType(self: IdResult) IdResultType {
\\ return .{.id = self.id};
\\ }
\\};
\\pub const IdRef = struct{ id: Word };
\\pub const IdResultType = IdResult;
\\pub const IdRef = IdResult;
\\
\\pub const IdMemorySemantics = IdRef;
\\pub const IdScope = IdRef;