VideoBackends: Clamp the range to the maximum depth value supported in the z buffer.
This commit is contained in:
parent
2ab6711f43
commit
65b5765858
|
@ -559,7 +559,7 @@ void Renderer::SetViewport()
|
|||
float Y = Renderer::EFBToScaledYf(xfmem.viewport.yOrig + xfmem.viewport.ht - scissorYOff);
|
||||
float Wd = Renderer::EFBToScaledXf(2.0f * xfmem.viewport.wd);
|
||||
float Ht = Renderer::EFBToScaledYf(-2.0f * xfmem.viewport.ht);
|
||||
float range = MathUtil::Clamp<float>(xfmem.viewport.zRange, 0.0f, 16777216.0f);
|
||||
float range = MathUtil::Clamp<float>(xfmem.viewport.zRange, 0.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;
|
||||
|
|
|
@ -464,7 +464,7 @@ void Renderer::SetViewport()
|
|||
float y = Renderer::EFBToScaledYf(xfmem.viewport.yOrig + xfmem.viewport.ht - scissor_y_offset);
|
||||
float width = Renderer::EFBToScaledXf(2.0f * xfmem.viewport.wd);
|
||||
float height = Renderer::EFBToScaledYf(-2.0f * xfmem.viewport.ht);
|
||||
float range = MathUtil::Clamp<float>(xfmem.viewport.zRange, 0.0f, 16777216.0f);
|
||||
float range = MathUtil::Clamp<float>(xfmem.viewport.zRange, 0.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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1635,7 +1635,7 @@ void Renderer::SetViewport()
|
|||
float y = Renderer::EFBToScaledYf(xfmem.viewport.yOrig + xfmem.viewport.ht - scissor_y_offset);
|
||||
float width = Renderer::EFBToScaledXf(2.0f * xfmem.viewport.wd);
|
||||
float height = Renderer::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;
|
||||
|
|
Loading…
Reference in New Issue