diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-13 04:25:52 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-23 01:28:48 +0100 |
commit | 287ae2b9e8ea38642a4c8e36f7863d881d4c0e87 (patch) | |
tree | feb26b3520031dfff59e7cf8e85018ab888cc2fa /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | gl_shader_cache: Specialize shared memory size (diff) | |
download | yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.tar yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.tar.gz yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.tar.bz2 yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.tar.lz yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.tar.xz yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.tar.zst yuzu-287ae2b9e8ea38642a4c8e36f7863d881d4c0e87.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index fb2ba0905..fe016c05c 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -510,10 +510,14 @@ private: } void DeclareLocalMemory() { - // TODO(Rodrigo): Unstub kernel local memory size and pass it from a register at - // specialization time. - const u64 local_memory_size = - stage == ProgramType::Compute ? 0x400 : header.GetLocalMemorySize(); + if (stage == ProgramType::Compute) { + code.AddLine("#ifdef LOCAL_MEMORY_SIZE"); + code.AddLine("uint {}[LOCAL_MEMORY_SIZE];", GetLocalMemory()); + code.AddLine("#endif"); + return; + } + + const u64 local_memory_size = header.GetLocalMemorySize(); if (local_memory_size == 0) { return; } @@ -851,9 +855,6 @@ private: } if (const auto lmem = std::get_if<LmemNode>(&*node)) { - if (stage == ProgramType::Compute) { - LOG_WARNING(Render_OpenGL, "Local memory is stubbed on compute shaders"); - } return { fmt::format("{}[{} >> 2]", GetLocalMemory(), Visit(lmem->GetAddress()).AsUint()), Type::Uint}; @@ -1228,9 +1229,6 @@ private: } target = std::move(*output); } else if (const auto lmem = std::get_if<LmemNode>(&*dest)) { - if (stage == ProgramType::Compute) { - LOG_WARNING(Render_OpenGL, "Local memory is stubbed on compute shaders"); - } target = { fmt::format("{}[{} >> 2]", GetLocalMemory(), Visit(lmem->GetAddress()).AsUint()), Type::Uint}; |