From 13ca08b2357e8dec7ffa79d04116dd842e623d1c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 10 Sep 2022 14:56:13 -0700 Subject: [PATCH] softgpu: Avoid over-aggressive rect conversion. The TL and BR have to match between UVs and pos, not enough for UV to be in order. This was causing an artifact on Chains of Olympus' title. --- GPU/Software/RasterizerRectangle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPU/Software/RasterizerRectangle.cpp b/GPU/Software/RasterizerRectangle.cpp index 79162dc607..f3ba20840a 100644 --- a/GPU/Software/RasterizerRectangle.cpp +++ b/GPU/Software/RasterizerRectangle.cpp @@ -435,7 +435,9 @@ bool DetectRectangleFromFan(const RasterizerState &state, const VertexData *data if (textl.x == texbl.x && textr.x == texbr.x && textl.y == textr.y && texbl.y == texbr.y) { // Okay, the texture is also good, but let's avoid rotation issues. - return textl.y < texbr.y && textl.x < texbr.x; + const auto &postl = data[*tlIndex].screenpos; + const auto &posbr = data[*brIndex].screenpos; + return textl.y < texbr.y && postl.y < posbr.y && textl.x < texbr.x && postl.x < posbr.x; } } }