don't compile cs with higher shared memory than supported (#2175)

This commit is contained in:
polybiusproxy 2025-01-17 21:51:33 +01:00 committed by GitHub
parent 4e8c178aec
commit 99a04357d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 0 deletions

View file

@ -239,6 +239,11 @@ public:
return subgroup_size;
}
/// Returns the maximum size of compute shared memory.
u32 MaxComputeSharedMemorySize() const {
return properties.limits.maxComputeSharedMemorySize;
}
/// Returns the maximum supported elements in a texel buffer
u32 MaxTexelBufferElements() const {
return properties.limits.maxTexelBufferElements;

View file

@ -183,6 +183,7 @@ const Shader::RuntimeInfo& PipelineCache::BuildRuntimeInfo(Stage stage, LogicalS
info.cs_info.tgid_enable = {cs_pgm.IsTgidEnabled(0), cs_pgm.IsTgidEnabled(1),
cs_pgm.IsTgidEnabled(2)};
info.cs_info.shared_memory_size = cs_pgm.SharedMemSize();
info.cs_info.max_shared_memory_size = instance.MaxComputeSharedMemorySize();
break;
}
default: