VideoBackends: Clamp the range to the maximum depth value supported in the z buffer.

This commit is contained in:
Jules Blok
2016-12-27 20:25:40 +01:00
parent 2ab6711f43
commit 65b5765858
4 changed files with 4 additions and 4 deletions

View File

@ -1122,7 +1122,7 @@ void Renderer::SetViewport()
(float)scissorYOff);
float Width = EFBToScaledXf(2.0f * xfmem.viewport.wd);
float Height = EFBToScaledYf(-2.0f * xfmem.viewport.ht);
float range = MathUtil::Clamp<float>(xfmem.viewport.zRange, -16777216.0f, 16777216.0f);
float range = MathUtil::Clamp<float>(xfmem.viewport.zRange, -16777215.0f, 16777215.0f);
float min_depth =
MathUtil::Clamp<float>(xfmem.viewport.farZ - range, 0.0f, 16777215.0f) / 16777216.0f;
float max_depth = MathUtil::Clamp<float>(xfmem.viewport.farZ, 0.0f, 16777215.0f) / 16777216.0f;