spirv: Use runtime array for ssbos
* ssbos can be large and typically their size will vary, especially in generic copy/clear cs shaders
This commit is contained in:
parent
6ef31ef6ea
commit
27e9026f5d
|
@ -331,7 +331,8 @@ void EmitContext::DefineBuffers() {
|
||||||
for (u32 i = 0; const auto& buffer : info.buffers) {
|
for (u32 i = 0; const auto& buffer : info.buffers) {
|
||||||
const auto* data_types = True(buffer.used_types & IR::Type::F32) ? &F32 : &U32;
|
const auto* data_types = True(buffer.used_types & IR::Type::F32) ? &F32 : &U32;
|
||||||
const Id data_type = (*data_types)[1];
|
const Id data_type = (*data_types)[1];
|
||||||
const Id record_array_type{TypeArray(data_type, ConstU32(buffer.length))};
|
const Id record_array_type{buffer.is_storage ? TypeRuntimeArray(data_type) :
|
||||||
|
TypeArray(data_type, ConstU32(buffer.length))};
|
||||||
const Id struct_type{TypeStruct(record_array_type)};
|
const Id struct_type{TypeStruct(record_array_type)};
|
||||||
if (std::ranges::find(type_ids, record_array_type.value, &Id::value) == type_ids.end()) {
|
if (std::ranges::find(type_ids, record_array_type.value, &Id::value) == type_ids.end()) {
|
||||||
Decorate(record_array_type, spv::Decoration::ArrayStride, 4);
|
Decorate(record_array_type, spv::Decoration::ArrayStride, 4);
|
||||||
|
|
Loading…
Reference in New Issue