add storage_buffer address space

This commit is contained in:
Robin Voetter 2024-11-02 18:54:34 +01:00
parent 688d7055e3
commit d35dfc5a3f
No known key found for this signature in database
5 changed files with 5 additions and 3 deletions

View File

@ -1573,7 +1573,7 @@ pub const Cpu = struct {
.fs, .gs, .ss => arch == .x86_64 or arch == .x86, .fs, .gs, .ss => arch == .x86_64 or arch == .x86,
.global, .constant, .local, .shared => is_gpu, .global, .constant, .local, .shared => is_gpu,
.param => is_nvptx, .param => is_nvptx,
.input, .output, .uniform, .push_constant => is_spirv, .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
// TODO this should also check how many flash banks the cpu has // TODO this should also check how many flash banks the cpu has
.flash, .flash1, .flash2, .flash3, .flash4, .flash5 => arch == .avr, .flash, .flash1, .flash2, .flash3, .flash4, .flash5 => arch == .avr,

View File

@ -515,6 +515,7 @@ pub const AddressSpace = enum(u5) {
output, output,
uniform, uniform,
push_constant, push_constant,
storage_buffer,
// AVR address spaces. // AVR address spaces.
flash, flash,

View File

@ -37852,7 +37852,7 @@ pub fn analyzeAsAddressSpace(
.gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer, .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,
// TODO: check that .shared and .local are left uninitialized // TODO: check that .shared and .local are left uninitialized
.param => is_nv, .param => is_nv,
.input, .output, .uniform, .push_constant => is_spirv, .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
.global, .shared, .local => is_gpu, .global, .shared, .local => is_gpu,
.constant => is_gpu and (ctx == .constant), .constant => is_gpu and (ctx == .constant),
// TODO this should also check how many flash banks the cpu has // TODO this should also check how many flash banks the cpu has

View File

@ -1893,6 +1893,7 @@ const NavGen = struct {
.input => .Input, .input => .Input,
.output => .Output, .output => .Output,
.uniform => .Uniform, .uniform => .Uniform,
.storage_buffer => .StorageBuffer,
.gs, .gs,
.fs, .fs,
.ss, .ss,

View File

@ -458,7 +458,7 @@ pub fn arePointersLogical(target: std.Target, as: AddressSpace) bool {
.global => false, .global => false,
// TODO: Allowed with VK_KHR_variable_pointers. // TODO: Allowed with VK_KHR_variable_pointers.
.shared => true, .shared => true,
.constant, .local, .input, .output, .uniform, .push_constant => true, .constant, .local, .input, .output, .uniform, .push_constant, .storage_buffer => true,
else => unreachable, else => unreachable,
}; };
} }