From 4323a4c31de8ef7a78c75e169b348bf80999da91 Mon Sep 17 00:00:00 2001 From: psucien Date: Sun, 9 Feb 2025 21:45:36 +0100 Subject: [PATCH] remove UBO size from spec and always set it to max on shader side --- src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | 3 +-- src/shader_recompiler/specialization.h | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index cad846b78..2ab5ca05d 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -634,8 +634,7 @@ void EmitContext::DefineBuffers() { for (const auto& desc : info.buffers) { const auto sharp = desc.GetSharp(info); const bool is_storage = desc.IsStorage(sharp, profile); - const u32 array_size = - sharp.NumDwords() != 0 ? sharp.NumDwords() : profile.max_ubo_size >> 2; + const u32 array_size = profile.max_ubo_size >> 2; 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) diff --git a/src/shader_recompiler/specialization.h b/src/shader_recompiler/specialization.h index 417021070..9bf9e71e4 100644 --- a/src/shader_recompiler/specialization.h +++ b/src/shader_recompiler/specialization.h @@ -27,7 +27,6 @@ struct BufferSpecialization { u32 num_format : 4; u32 index_stride : 2; u32 element_size : 2; - u32 size = 0; AmdGpu::CompMapping dst_select{}; AmdGpu::NumberConversion num_conversion{}; @@ -38,8 +37,7 @@ struct BufferSpecialization { (data_format == other.data_format && num_format == other.num_format && dst_select == other.dst_select && num_conversion == other.num_conversion)) && (!swizzle_enable || - (index_stride == other.index_stride && element_size == other.element_size)) && - (size >= other.is_storage || is_storage); + (index_stride == other.index_stride && element_size == other.element_size)); } }; @@ -122,9 +120,6 @@ struct StageSpecialization { spec.index_stride = sharp.index_stride; spec.element_size = sharp.element_size; } - if (!spec.is_storage) { - spec.size = sharp.GetSize(); - } }); ForEachSharp(binding, images, info->images, [](auto& spec, const auto& desc, AmdGpu::Image sharp) {