VideoCommon: Implement depth range equation in vertex shader.

This commit is contained in:
Jules Blok
2016-08-03 02:01:36 +02:00
parent 0015d2e86b
commit c223bd47b9
3 changed files with 11 additions and 12 deletions

View File

@ -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();