From 1b3b12caa01d9ee77a9e3740d52f66ece1456d4b Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sun, 8 Dec 2013 14:31:33 +0100 Subject: [PATCH] PixelShaderGen: Fix an issue where small negative z coordinates would underflow when they shouldn't. --- Source/Core/VideoCommon/PixelShaderGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 5a051b894c..1a15d3ad04 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -590,7 +590,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T // U24 overflow emulation out.Write("zCoord = zCoord * (16777215.0/16777216.0);\n"); - out.Write("zCoord = frac(zCoord);\n"); + out.Write("zCoord = zCoord - 2.0*round(0.5*zCoord);\n"); out.Write("zCoord = zCoord * (16777216.0/16777215.0);\n"); }