From c5a98e62dd0f30b152d0609f821c52816f5678fb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 1 Dec 2022 21:56:05 -0800 Subject: [PATCH] softgpu: Cull verts outside post-viewport Z. Shouldn't have removed this before, points are still culled when depth clamp is off and throughmode is off. Fixes Crazy Taxi graphics glitches. --- GPU/Software/TransformUnit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index 0119250316..ffe1119157 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -181,7 +181,7 @@ static ScreenCoords ClipToScreenInternal(Vec3f scaled, const ClipCoords &coords, scaled.z = 0.f; else if (scaled.z > 65535.0f) scaled.z = 65535.0f; - } else if (scaled.x > SCREEN_BOUND || scaled.y >= SCREEN_BOUND || scaled.x < 0 || scaled.y < 0) { + } else if (scaled.x > SCREEN_BOUND || scaled.y >= SCREEN_BOUND || scaled.x < 0 || scaled.y < 0 || scaled.z < 0.0f || scaled.z >= 65536.0f) { *outside_range_flag = true; }