diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-07-16 21:02:46 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-07-16 21:02:46 +0200 |
commit | a5a72cbd201489319856baaec88f02a6607423ae (patch) | |
tree | a260784d8810d6c3f982d77e7c7ebaa5dbf957c7 /src/video_core/renderer_opengl/gl_arb_decompiler.cpp | |
parent | Merge pull request #4342 from lioncash/endian (diff) | |
download | yuzu-a5a72cbd201489319856baaec88f02a6607423ae.tar yuzu-a5a72cbd201489319856baaec88f02a6607423ae.tar.gz yuzu-a5a72cbd201489319856baaec88f02a6607423ae.tar.bz2 yuzu-a5a72cbd201489319856baaec88f02a6607423ae.tar.lz yuzu-a5a72cbd201489319856baaec88f02a6607423ae.tar.xz yuzu-a5a72cbd201489319856baaec88f02a6607423ae.tar.zst yuzu-a5a72cbd201489319856baaec88f02a6607423ae.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_arb_decompiler.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_arb_decompiler.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp index eb5158407..31dd08fd2 100644 --- a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp @@ -892,11 +892,19 @@ void ARBDecompiler::DeclareCompute() { const ComputeInfo& info = registry.GetComputeInfo(); AddLine("GROUP_SIZE {} {} {};", info.workgroup_size[0], info.workgroup_size[1], info.workgroup_size[2]); - if (info.shared_memory_size_in_words > 0) { - const u32 size_in_bytes = info.shared_memory_size_in_words * 4; - AddLine("SHARED_MEMORY {};", size_in_bytes); - AddLine("SHARED shared_mem[] = {{program.sharedmem}};"); + if (info.shared_memory_size_in_words == 0) { + return; + } + const u32 limit = device.GetMaxComputeSharedMemorySize(); + u32 size_in_bytes = info.shared_memory_size_in_words * 4; + if (size_in_bytes > limit) { + LOG_ERROR(Render_OpenGL, "Shared memory size {} is clamped to host's limit {}", + size_in_bytes, limit); + size_in_bytes = limit; } + + AddLine("SHARED_MEMORY {};", size_in_bytes); + AddLine("SHARED shared_mem[] = {{program.sharedmem}};"); } void ARBDecompiler::DeclareInputAttributes() { |