mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-09 11:05:56 +00:00
VideoCommon: Implement depth range equation in vertex shader.
This commit is contained in:
parent
0015d2e86b
commit
c223bd47b9
3 changed files with 11 additions and 12 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue