Fix half pixel getting applied twice to reverse Z vertex shaders. (#21)

This commit is contained in:
Skyth (Asilkan) 2025-08-03 16:45:31 +03:00 committed by GitHub
parent 421e3b3e79
commit 990d03b28a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 += "}";