mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoCommon: Implement depth range equation in vertex shader.
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user