From d9501cb0ad2056df545fb9ce41c2f1156e7d1394 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 5 Dec 2022 23:09:55 -0800 Subject: [PATCH] softgpu: Fix w culling of triangle rects. --- GPU/Software/RasterizerRectangle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GPU/Software/RasterizerRectangle.cpp b/GPU/Software/RasterizerRectangle.cpp index a8713dad97..2ce43cba89 100644 --- a/GPU/Software/RasterizerRectangle.cpp +++ b/GPU/Software/RasterizerRectangle.cpp @@ -413,6 +413,9 @@ static bool AreCoordsRectangleCompatible(const RasterizerState &state, const Cli if (data1.clippos.w - halftexel > data0.clippos.w || data1.clippos.w + halftexel < data0.clippos.w) return false; } + // We might need to cull this if all verts have negative w, which doesn't seem to happen for rectangles. + if (data0.clippos.w < 0.0f && data1.clippos.w < 0.0f) + return false; // If we're projecting textures, only allow an exact match for simplicity. if (state.enableTextures && data1.v.texturecoords.q() != data0.v.texturecoords.q()) return false;