mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-23 11:55:00 +00:00
shader_recompiler: Set array size to max UBO size when 0. (#1251)
* shader_recompiler: Set array size to max UBO size when 0. * vulkan: Account for fallbacks when setting depth attachment format.
This commit is contained in:
parent
ee57c2fd69
commit
8576d5e72c
3 changed files with 8 additions and 5 deletions
|
@ -390,11 +390,11 @@ void EmitContext::DefineBuffers() {
|
|||
for (const auto& desc : info.buffers) {
|
||||
const auto sharp = desc.GetSharp(info);
|
||||
const bool is_storage = desc.IsStorage(sharp);
|
||||
const u32 array_size = sharp.NumDwords() != 0 ? sharp.NumDwords() : MaxUboDwords;
|
||||
const auto* data_types = True(desc.used_types & IR::Type::F32) ? &F32 : &U32;
|
||||
const Id data_type = (*data_types)[1];
|
||||
const Id record_array_type{
|
||||
is_storage ? TypeRuntimeArray(data_type)
|
||||
: TypeArray(data_type, ConstU32(std::max(sharp.NumDwords(), 1U)))};
|
||||
const Id record_array_type{is_storage ? TypeRuntimeArray(data_type)
|
||||
: TypeArray(data_type, ConstU32(array_size))};
|
||||
const Id struct_type{define_struct(record_array_type, desc.is_instance_data)};
|
||||
|
||||
const auto storage_class =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue