Use Vertex Depth Range when zRange Exceeds farZ
When the inverted depth range is unsupported and zRange is greater than farZ then min_depth becomes a negative value and far_depth will then exceed a depth of 1.0 (which is outside the scope of most backends and greater than GX_MAX_DEPTH of the console). This happens when the backend supports depth clamping the min_depth is not clamped to zero.
This commit is contained in:
parent
467c7435d1
commit
9e950c6959
|
@ -168,9 +168,15 @@ bool VertexShaderManager::UseVertexDepthRange()
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If an inverted depth range is unsupported, we also need to check if the range is inverted.
|
// If an inverted depth range is unsupported, we also need to check if the range is inverted.
|
||||||
if (!g_ActiveConfig.backend_info.bSupportsReversedDepthRange && xfmem.viewport.zRange < 0.0f)
|
if (!g_ActiveConfig.backend_info.bSupportsReversedDepthRange)
|
||||||
|
{
|
||||||
|
if (xfmem.viewport.zRange < 0.0f)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (xfmem.viewport.zRange > xfmem.viewport.farZ)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// If an oversized depth range or a ztexture is used, we need to calculate the depth range
|
// If an oversized depth range or a ztexture is used, we need to calculate the depth range
|
||||||
// in the vertex shader.
|
// in the vertex shader.
|
||||||
return fabs(xfmem.viewport.zRange) > 16777215.0f || fabs(xfmem.viewport.farZ) > 16777215.0f;
|
return fabs(xfmem.viewport.zRange) > 16777215.0f || fabs(xfmem.viewport.farZ) > 16777215.0f;
|
||||||
|
|
Loading…
Reference in New Issue