OGL: Handle cases where reversed depth is already used.

This commit is contained in:
Jules Blok
2016-08-21 17:47:24 +02:00
parent 92f165d756
commit a8a9348913
6 changed files with 32 additions and 3 deletions

View File

@ -1160,9 +1160,16 @@ void Renderer::SetViewport()
// value supported by the console GPU. If not, we simply clamp the near/far values
// themselves to the maximum value as done above.
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
glDepthRangef(GX_MAX_DEPTH, 0.0f);
{
if (xfmem.viewport.zRange < 0.0f)
glDepthRangef(0.0f, GX_MAX_DEPTH);
else
glDepthRangef(GX_MAX_DEPTH, 0.0f);
}
else
{
glDepthRangef(GLFar, GLNear);
}
}
void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable,