From 4c67c33f01ec45f50893ffcf443bb138efd6dbca Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:28:16 +0300 Subject: [PATCH] Shader decompiler: Optimize mova with both x and y masked --- src/core/PICA/shader_decompiler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/PICA/shader_decompiler.cpp b/src/core/PICA/shader_decompiler.cpp index da880fcc2..75bdb4ce4 100644 --- a/src/core/PICA/shader_decompiler.cpp +++ b/src/core/PICA/shader_decompiler.cpp @@ -453,10 +453,9 @@ void ShaderDecompiler::compileInstruction(u32& pc, bool& finished) { const bool writeY = getBit<2>(operandDescriptor); if (writeX) { + decompiledShader += fmt::format("addr_reg.xy = ivec2({}.xy);\n", src1); decompiledShader += fmt::format("addr_reg.x = int({}.x);\n", src1); - } - - if (writeY) { + } else if (writeY) { decompiledShader += fmt::format("addr_reg.y = int({}.y);\n", src1); } break;