diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 6236c5cdd..50b616be4 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -344,14 +344,16 @@ private: | |||
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | void DeclareLocalMemory() { | 346 | void DeclareLocalMemory() { |
| 347 | if (stage == ProgramType::Compute) { | 347 | // TODO(Rodrigo): Unstub kernel local memory size and pass it from a register at |
| 348 | // specialization time. | ||
| 349 | const u64 local_memory_size = | ||
| 350 | stage == ProgramType::Compute ? 0x400 : header.GetLocalMemorySize(); | ||
| 351 | if (local_memory_size == 0) { | ||
| 348 | return; | 352 | return; |
| 349 | } | 353 | } |
| 350 | if (const u64 local_memory_size = header.GetLocalMemorySize(); local_memory_size > 0) { | 354 | const auto element_count = Common::AlignUp(local_memory_size, 4) / 4; |
| 351 | const auto element_count = Common::AlignUp(local_memory_size, 4) / 4; | 355 | code.AddLine("float {}[{}];", GetLocalMemory(), element_count); |
| 352 | code.AddLine("float {}[{}];", GetLocalMemory(), element_count); | 356 | code.AddNewLine(); |
| 353 | code.AddNewLine(); | ||
| 354 | } | ||
| 355 | } | 357 | } |
| 356 | 358 | ||
| 357 | void DeclareInternalFlags() { | 359 | void DeclareInternalFlags() { |
| @@ -703,7 +705,9 @@ private: | |||
| 703 | } | 705 | } |
| 704 | 706 | ||
| 705 | if (const auto lmem = std::get_if<LmemNode>(&*node)) { | 707 | if (const auto lmem = std::get_if<LmemNode>(&*node)) { |
| 706 | UNIMPLEMENTED_IF(stage == ProgramType::Compute); | 708 | if (stage == ProgramType::Compute) { |
| 709 | LOG_WARNING(Render_OpenGL, "Local memory is stubbed on compute shaders"); | ||
| 710 | } | ||
| 707 | return fmt::format("{}[ftou({}) / 4]", GetLocalMemory(), Visit(lmem->GetAddress())); | 711 | return fmt::format("{}[ftou({}) / 4]", GetLocalMemory(), Visit(lmem->GetAddress())); |
| 708 | } | 712 | } |
| 709 | 713 | ||
| @@ -1080,7 +1084,9 @@ private: | |||
| 1080 | target = result->first; | 1084 | target = result->first; |
| 1081 | is_integer = result->second; | 1085 | is_integer = result->second; |
| 1082 | } else if (const auto lmem = std::get_if<LmemNode>(&*dest)) { | 1086 | } else if (const auto lmem = std::get_if<LmemNode>(&*dest)) { |
| 1083 | UNIMPLEMENTED_IF(stage == ProgramType::Compute); | 1087 | if (stage == ProgramType::Compute) { |
| 1088 | LOG_WARNING(Render_OpenGL, "Local memory is stubbed on compute shaders"); | ||
| 1089 | } | ||
| 1084 | target = fmt::format("{}[ftou({}) / 4]", GetLocalMemory(), Visit(lmem->GetAddress())); | 1090 | target = fmt::format("{}[ftou({}) / 4]", GetLocalMemory(), Visit(lmem->GetAddress())); |
| 1085 | } else if (const auto gmem = std::get_if<GmemNode>(&*dest)) { | 1091 | } else if (const auto gmem = std::get_if<GmemNode>(&*dest)) { |
| 1086 | const std::string real = Visit(gmem->GetRealAddress()); | 1092 | const std::string real = Visit(gmem->GetRealAddress()); |