From 674f4f3023953c86db2fa76dce5591256e0a2951 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Sun, 3 Aug 2025 16:38:21 +0300 Subject: [PATCH] Fix half pixel getting applied twice to reverse Z vertex shaders. --- XenosRecomp/shader_recompiler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/XenosRecomp/shader_recompiler.cpp b/XenosRecomp/shader_recompiler.cpp index d4cbd50..698a418 100644 --- a/XenosRecomp/shader_recompiler.cpp +++ b/XenosRecomp/shader_recompiler.cpp @@ -1828,7 +1828,12 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi } else { - out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n"; + #ifdef UNLEASHED_RECOMP + if (!hasMtxProjection) + #endif + { + out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n"; + } } if (simpleControlFlow) @@ -1874,6 +1879,9 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi #ifdef UNLEASHED_RECOMP if (hasMtxProjection) out += "\t}\n"; + + if (!isPixelShader && hasMtxProjection) + out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n"; #endif out += "}";