diff options
| author | Dolphin Bot <dolphin-emu-bot@users.noreply.github.com> | 2015-05-08 15:20:57 +0200 |
|---|---|---|
| committer | Dolphin Bot <dolphin-emu-bot@users.noreply.github.com> | 2015-05-08 15:20:57 +0200 |
| commit | ca7fe09f1adda29b8ac76ffa492b2d1e96649e6b (patch) | |
| tree | 1f9c0beba0e258cd796e34aa900271576de02b76 /Source/Core/VideoBackends/D3D/PixelShaderCache.cpp | |
| parent | 268b8fd26f8888bf08873bbc8d94b7eea00a402c (diff) | |
| parent | 1d745d632ab9f4774bc38782cd688a5fa48bc097 (diff) | |
Merge pull request #2369 from Armada651/depth-percision
VideoBackends: Use proper floating point depth precision.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/PixelShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/PixelShaderCache.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp b/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp index 3e2c6292c0..eef2fdbe7a 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 * float(0xFFFFFF)));\n" + " int depth = clamp(int(texcol.x * 16777216.0), 0, 0xFFFFFF);\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 * float(0xFFFFFF)));\n" + " int depth = clamp(int(texcol.x * 16777216.0), 0, 0xFFFFFF);\n" // Convert to Z24 format " int4 workspace;\n" |
