From 213183895abe05e4720520dbce6f06ba7cee1403 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:15:03 +0300 Subject: [PATCH] Further simplify shader decompiler output --- src/core/PICA/shader_decompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PICA/shader_decompiler.cpp b/src/core/PICA/shader_decompiler.cpp index d2414c13..5559bcc5 100644 --- a/src/core/PICA/shader_decompiler.cpp +++ b/src/core/PICA/shader_decompiler.cpp @@ -182,7 +182,6 @@ std::string ShaderDecompiler::getSwizzlePattern(u32 swizzle) const { std::string ShaderDecompiler::getDestSwizzle(u32 destinationMask) const { std::string ret = "."; - if (destinationMask & 0b1000) { ret += "x"; } @@ -214,7 +213,8 @@ void ShaderDecompiler::setDest(u32 operandDescriptor, const std::string& dest, c return; } - decompiledShader += dest + destSwizzle + " = "; + // Don't write destination swizzle if all lanes are getting written to + decompiledShader += fmt::format("{}{} = ", dest, writtenLaneCount == 4 ? "" : destSwizzle); if (writtenLaneCount == 1) { decompiledShader += "float(" + value + ");\n"; } else if (writtenLaneCount <= 3) { // We don't need to cast for vec4, as we guarantee the rhs will be a vec4