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

@ -1115,12 +1115,6 @@ void Renderer::SetViewport()
(float)scissorYOff);
float Width = EFBToScaledXf(2.0f * xfmem.viewport.wd);
float Height = EFBToScaledYf(-2.0f * xfmem.viewport.ht);
float GLNear = MathUtil::Clamp<float>(
xfmem.viewport.farZ -
MathUtil::Clamp<float>(xfmem.viewport.zRange, -16777216.0f, 16777216.0f),
0.0f, 16777215.0f) /
16777216.0f;
float GLFar = MathUtil::Clamp<float>(xfmem.viewport.farZ, 0.0f, 16777215.0f) / 16777216.0f;
if (Width < 0)
{
X += Width;
@ -1142,7 +1136,7 @@ void Renderer::SetViewport()
auto iceilf = [](float f) { return static_cast<GLint>(ceilf(f)); };
glViewport(iceilf(X), iceilf(Y), iceilf(Width), iceilf(Height));
}
glDepthRangef(GLFar, GLNear);
glDepthRangef(0.0f, 1.0f);
}
void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable,