mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
Clamp compute LDS to the device limit and ignore unopenable gamepads
This commit is contained in:
@@ -658,6 +658,19 @@ ShaderProgram PipelineCache::GetComputeProgram(const HW::ComputeShaderInfo& regs
|
||||
ShaderComputeInputInfo& input_info) {
|
||||
input_info.host_subgroup_size = m_graphics.SupportsComputeWave64() ? 64u : 32u;
|
||||
const auto params = PrepareProgram(regs, sh, input_info);
|
||||
// Use one effective size for the cache key, LDS declaration, and access bounds.
|
||||
const auto max_lds_dwords =
|
||||
m_graphics.GetPhysicalDeviceProperties().limits.maxComputeSharedMemorySize / 4u;
|
||||
if (input_info.lds_size_dwords > max_lds_dwords) {
|
||||
static std::atomic_bool warned = false;
|
||||
if (!warned.exchange(true, std::memory_order_relaxed)) {
|
||||
PipelineCacheLog("GPU warning: game compute shader requests {} bytes of LDS, but "
|
||||
"the Vulkan device limit is {} bytes. Clamping LDS; rendering may "
|
||||
"be incorrect.",
|
||||
input_info.lds_size_dwords * 4u, max_lds_dwords * 4u);
|
||||
}
|
||||
}
|
||||
input_info.lds_size_dwords = std::min(input_info.lds_size_dwords, max_lds_dwords);
|
||||
uint32_t push_data_cursor = 0;
|
||||
return m_program_cache->Get(params, input_info, push_data_cursor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user