authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-11-02 18:54:34+01:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-11-08 20:43:57+01:00
logd35dfc5a3ff48331473ca42b97f3a8cba7d4ad9b
tree8d4f36f7bcbe628ce89b6503bcf8ed579761b0c2
parent688d7055e3c483249391c66bfe02c084477ad81b
signaturebadge-check Signed by SSH key SHA256:ZS52FNyUv2WUXvO4njmVaFVO46RHojFuOrxRc4LuKzg

add storage_buffer address space


5 files changed, 5 insertions(+), 3 deletions(-)

lib/std/Target.zig+1-1
......@@ -1573,7 +1573,7 @@ pub const Cpu = struct {
15731573 .fs, .gs, .ss => arch == .x86_64 or arch == .x86,
15741574 .global, .constant, .local, .shared => is_gpu,
15751575 .param => is_nvptx,
1576 .input, .output, .uniform, .push_constant => is_spirv,
1576 .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
15771577 // TODO this should also check how many flash banks the cpu has
15781578 .flash, .flash1, .flash2, .flash3, .flash4, .flash5 => arch == .avr,
15791579
lib/std/builtin.zig+1
......@@ -515,6 +515,7 @@ pub const AddressSpace = enum(u5) {
515515 output,
516516 uniform,
517517 push_constant,
518 storage_buffer,
518519
519520 // AVR address spaces.
520521 flash,
src/Sema.zig+1-1
......@@ -37852,7 +37852,7 @@ pub fn analyzeAsAddressSpace(
3785237852 .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,
3785337853 // TODO: check that .shared and .local are left uninitialized
3785437854 .param => is_nv,
37855 .input, .output, .uniform, .push_constant => is_spirv,
37855 .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
3785637856 .global, .shared, .local => is_gpu,
3785737857 .constant => is_gpu and (ctx == .constant),
3785837858 // TODO this should also check how many flash banks the cpu has
src/codegen/spirv.zig+1
......@@ -1893,6 +1893,7 @@ const NavGen = struct {
18931893 .input => .Input,
18941894 .output => .Output,
18951895 .uniform => .Uniform,
1896 .storage_buffer => .StorageBuffer,
18961897 .gs,
18971898 .fs,
18981899 .ss,
src/target.zig+1-1
......@@ -458,7 +458,7 @@ pub fn arePointersLogical(target: std.Target, as: AddressSpace) bool {
458458 .global => false,
459459 // TODO: Allowed with VK_KHR_variable_pointers.
460460 .shared => true,
461 .constant, .local, .input, .output, .uniform, .push_constant => true,
461 .constant, .local, .input, .output, .uniform, .push_constant, .storage_buffer => true,
462462 else => unreachable,
463463 };
464464}