Skip to content

Commit 990d03b

Browse files
Fix half pixel getting applied twice to reverse Z vertex shaders. (#21)
1 parent 421e3b3 commit 990d03b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

XenosRecomp/shader_recompiler.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,12 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi
18281828
}
18291829
else
18301830
{
1831-
out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n";
1831+
#ifdef UNLEASHED_RECOMP
1832+
if (!hasMtxProjection)
1833+
#endif
1834+
{
1835+
out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n";
1836+
}
18321837
}
18331838

18341839
if (simpleControlFlow)
@@ -1874,6 +1879,9 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi
18741879
#ifdef UNLEASHED_RECOMP
18751880
if (hasMtxProjection)
18761881
out += "\t}\n";
1882+
1883+
if (!isPixelShader && hasMtxProjection)
1884+
out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n";
18771885
#endif
18781886

18791887
out += "}";

0 commit comments

Comments
 (0)