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 {...@@ -1573,7 +1573,7 @@ pub const Cpu = struct {
1573 .fs, .gs, .ss => arch == .x86_64 or arch == .x86,1573 .fs, .gs, .ss => arch == .x86_64 or arch == .x86,
1574 .global, .constant, .local, .shared => is_gpu,1574 .global, .constant, .local, .shared => is_gpu,
1575 .param => is_nvptx,1575 .param => is_nvptx,
1576 .input, .output, .uniform, .push_constant => is_spirv,1576 .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
1577 // TODO this should also check how many flash banks the cpu has1577 // TODO this should also check how many flash banks the cpu has
1578 .flash, .flash1, .flash2, .flash3, .flash4, .flash5 => arch == .avr,1578 .flash, .flash1, .flash2, .flash3, .flash4, .flash5 => arch == .avr,
15791579
lib/std/builtin.zig+1
...@@ -515,6 +515,7 @@ pub const AddressSpace = enum(u5) {...@@ -515,6 +515,7 @@ pub const AddressSpace = enum(u5) {
515 output,515 output,
516 uniform,516 uniform,
517 push_constant,517 push_constant,
518 storage_buffer,
518519
519 // AVR address spaces.520 // AVR address spaces.
520 flash,521 flash,
src/Sema.zig+1-1
...@@ -37852,7 +37852,7 @@ pub fn analyzeAsAddressSpace(...@@ -37852,7 +37852,7 @@ pub fn analyzeAsAddressSpace(
37852 .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,37852 .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,
37853 // TODO: check that .shared and .local are left uninitialized37853 // TODO: check that .shared and .local are left uninitialized
37854 .param => is_nv,37854 .param => is_nv,
37855 .input, .output, .uniform, .push_constant => is_spirv,37855 .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
37856 .global, .shared, .local => is_gpu,37856 .global, .shared, .local => is_gpu,
37857 .constant => is_gpu and (ctx == .constant),37857 .constant => is_gpu and (ctx == .constant),
37858 // TODO this should also check how many flash banks the cpu has37858 // TODO this should also check how many flash banks the cpu has
src/codegen/spirv.zig+1
...@@ -1893,6 +1893,7 @@ const NavGen = struct {...@@ -1893,6 +1893,7 @@ const NavGen = struct {
1893 .input => .Input,1893 .input => .Input,
1894 .output => .Output,1894 .output => .Output,
1895 .uniform => .Uniform,1895 .uniform => .Uniform,
1896 .storage_buffer => .StorageBuffer,
1896 .gs,1897 .gs,
1897 .fs,1898 .fs,
1898 .ss,1899 .ss,
src/target.zig+1-1
...@@ -458,7 +458,7 @@ pub fn arePointersLogical(target: std.Target, as: AddressSpace) bool {...@@ -458,7 +458,7 @@ pub fn arePointersLogical(target: std.Target, as: AddressSpace) bool {
458 .global => false,458 .global => false,
459 // TODO: Allowed with VK_KHR_variable_pointers.459 // TODO: Allowed with VK_KHR_variable_pointers.
460 .shared => true,460 .shared => true,
461 .constant, .local, .input, .output, .uniform, .push_constant => true,461 .constant, .local, .input, .output, .uniform, .push_constant, .storage_buffer => true,
462 else => unreachable,462 else => unreachable,
463 };463 };
464}464}