summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2015-05-05 23:34:45 +0200
committerJules Blok <jules.blok@gmail.com>2015-05-08 14:29:29 +0200
commitc4f85a38e630c80feb1deb9205d8bb3ff5b7caec (patch)
tree0f9ce212756d18947b48b93f19db6e237517f9db /Source/Core/VideoCommon/PixelShaderGen.cpp
parent268b8fd26f8888bf08873bbc8d94b7eea00a402c (diff)
VideoBackends: Use proper floating point depth precision.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 4873afc567..5581aa1f1d 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -1224,11 +1224,11 @@ static inline void WritePerPixelDepth(T& out, pixel_shader_uid_data* uid_data, A
if (ApiType == API_OPENGL)
out.Write("\tscreenpos.y = %i - screenpos.y;\n", EFB_HEIGHT);
- out.Write("\tdepth = float(" I_ZSLOPE".z + " I_ZSLOPE".x * screenpos.x + " I_ZSLOPE".y * screenpos.y) / float(0xFFFFFF);\n");
+ out.Write("\tdepth = float(" I_ZSLOPE".z + " I_ZSLOPE".x * screenpos.x + " I_ZSLOPE".y * screenpos.y) / 16777216.0;\n");
}
else
{
- out.Write("\tdepth = float(zCoord) / float(0xFFFFFF);\n");
+ out.Write("\tdepth = float(zCoord) / 16777216.0;\n");
}
}