summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2015-05-06 22:02:12 +0200
committerJules Blok <jules.blok@gmail.com>2015-05-08 14:29:30 +0200
commitb0770e2a0c2e391139db1365ca3658ada0f87da0 (patch)
treee4f78b3431eff2163e08924f6279e0b841b3084c /Source/Core/VideoBackends
parentbe810eb75038bce43054d9a4443d59c5ddf0be83 (diff)
VideoBackends: Floor depth values in depth copy shaders.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/D3D/PixelShaderCache.cpp4
-rw-r--r--Source/Core/VideoBackends/OGL/TextureCache.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp b/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp
index 4a2def325c..b6bbff313b 100644
--- a/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp
+++ b/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp
@@ -146,7 +146,7 @@ const char depth_matrix_program[] = {
" in float4 pos : SV_Position,\n"
" in float3 uv0 : TEXCOORD0){\n"
" float4 texcol = Tex0.Sample(samp0,uv0);\n"
- " int depth = int(round(texcol.x * 16777216.0));\n"
+ " int depth = int(floor(texcol.x * 16777216.0));\n"
// Convert to Z24 format
" int4 workspace;\n"
@@ -180,7 +180,7 @@ const char depth_matrix_program_msaa[] = {
" for(int i = 0; i < SAMPLES; ++i)\n"
" texcol += Tex0.Load(int3(uv0.x*(width), uv0.y*(height), uv0.z), i);\n"
" texcol /= SAMPLES;\n"
- " int depth = int(round(texcol.x * 16777216.0));\n"
+ " int depth = int(floor(texcol.x * 16777216.0));\n"
// Convert to Z24 format
" int4 workspace;\n"
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp
index 31979b8347..a904ca64af 100644
--- a/Source/Core/VideoBackends/OGL/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp
@@ -294,7 +294,7 @@ void TextureCache::CompileShaders()
"\n"
"void main(){\n"
" vec4 texcol = texture(samp9, vec3(f_uv0.xy, %s));\n"
- " int depth = int(round(texcol.x * 16777216.0));\n"
+ " int depth = int(floor(texcol.x * 16777216.0));\n"
// Convert to Z24 format
" ivec4 workspace;\n"