motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 45b5f467709e3df01aafc37c25070bbbebd43e1e (tree)
parent fe0fb93fa04bf4767058cc7046100f3c4f33b3d4
Author: Robin Voetter <robin@voetter.nl>
Date:   Sat,  8 Apr 2023 19:05:00 +0200

spirv: allow global, constant address spaces

These should actually just work fine in SPIR-V. They are mapped to CrossWorkgroup
and UniformConstant respectively.

Diffstat:
Msrc/codegen/spirv.zig | 17++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig @@ -1317,11 +1317,22 @@ pub const DeclGen = struct { fn spvStorageClass(as: std.builtin.AddressSpace) StorageClass { return switch (as) { - .generic => .Generic, // TODO: Disallow? - .gs, .fs, .ss => unreachable, + .generic => .Generic, .shared => .Workgroup, .local => .Private, - .global, .param, .constant, .flash, .flash1, .flash2, .flash3, .flash4, .flash5 => unreachable, + .global => .CrossWorkgroup, + .constant => .UniformConstant, + .gs, + .fs, + .ss, + .param, + .flash, + .flash1, + .flash2, + .flash3, + .flash4, + .flash5, + => unreachable, }; }