GPU: Cull rectangles more when depth clamp off.

If any vert is outside Z, it's culled when not clamping/clipping.
This commit is contained in:
Unknown W. Brackets committed 2021-10-12 20:34:41 -07:00
1 parent 5315c404c5
commit 4ac36cb810
1 file changed
+5 -1
+5 -1
View File
@@ -633,7 +633,11 @@ void SoftwareTransform::BuildDrawingParams(int prim, int vertexCount, u32 vertTy
// If both transformed verts are outside Z, cull this rectangle entirely.
constexpr float outsideValue = 1.000030517578125f;
if (fabsf(tl.z) >= outsideValue && fabsf(br.z) >= outsideValue)
bool tlOutside = fabsf(tl.z / tl.w) >= outsideValue;
bool brOutside = fabsf(br.z / br.w) >= outsideValue;
if (tlOutside && brOutside)
continue;
if (!gstate.isDepthClampEnabled() && (tlOutside || brOutside))
continue;
RotateUV(trans, tl, br, flippedY);