summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderManager.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2016-08-03 02:01:36 +0200
committerJules Blok <jules.blok@gmail.com>2016-08-15 13:11:23 +0200
commitc223bd47b9b2a83ed53201964e4912e2faec3d66 (patch)
tree914c4ae4ca1f8c01fbccef8516024fcf2f86914e /Source/Core/VideoCommon/VertexShaderManager.cpp
parent0015d2e86b76772a57fb4554c84c4b47adce341e (diff)
VideoCommon: Implement depth range equation in vertex shader.
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 19fb1f371d..0fb784167d 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -386,6 +386,11 @@ void VertexShaderManager::SetConstants()
const float pixel_size_y = 2.f / Renderer::EFBToScaledXf(2.f * xfmem.viewport.ht);
constants.pixelcentercorrection[0] = pixel_center_correction * pixel_size_x;
constants.pixelcentercorrection[1] = pixel_center_correction * pixel_size_y;
+
+ // The depth range is handled in the vertex shader.
+ constants.pixelcentercorrection[2] = (xfmem.viewport.zRange) / 16777216.0f;
+ constants.pixelcentercorrection[3] = (xfmem.viewport.farZ) / 16777216.0f;
+
dirty = true;
// This is so implementation-dependent that we can't have it here.
g_renderer->SetViewport();