aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2022-11-28 19:14:16 +0100
committerRobin Voetter <robin@voetter.nl>2023-04-09 01:51:51 +0200
commit700dee34d5c7bdedc678032689c761e3a417fa03 (patch)
tree3ddf95feb67fe929ab3f9ebd1fc716699af226f5 /tools
parent0c2526b18ec21d8155b070022d3b3b9069303744 (diff)
downloadzig-700dee34d5c7bdedc678032689c761e3a417fa03.tar.gz
zig-700dee34d5c7bdedc678032689c761e3a417fa03.zip
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.
Diffstat (limited to 'tools')
-rw-r--r--tools/gen_spirv_spec.zig15
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/gen_spirv_spec.zig b/tools/gen_spirv_spec.zig
index 31dbbb1911..5ed76448e4 100644
--- a/tools/gen_spirv_spec.zig
+++ b/tools/gen_spirv_spec.zig
@@ -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;