spirv: allow global, constant address spaces

These should actually just work fine in SPIR-V. They are mapped to CrossWorkgroup
and UniformConstant respectively.
This commit is contained in:
Robin Voetter 2023-04-08 19:05:00 +02:00
parent fe0fb93fa0
commit 45b5f46770
No known key found for this signature in database
GPG Key ID: E755662F227CB468

View File

@ -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,
};
}