From e104976cd8012d1658a7db50684157c4114c704d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 20 Dec 2024 20:28:15 +0100 Subject: [PATCH] Minor sign check optimization --- GPU/Common/DepthRaster.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GPU/Common/DepthRaster.cpp b/GPU/Common/DepthRaster.cpp index 9532e7b3cad7..ef7c4bc78f20 100644 --- a/GPU/Common/DepthRaster.cpp +++ b/GPU/Common/DepthRaster.cpp @@ -184,10 +184,12 @@ void DepthRasterTriangle(uint16_t *depthBuf, int stride, int x1, int y1, int x2, beta += A1, gamma += A2) { - int mask = alpha >= 0 && beta >= 0 && gamma >= 0; + int mask = alpha | beta | gamma; // Early out if all of this quad's pixels are outside the triangle. - if (!mask) { + if (mask < 0) { continue; + } else { + mask = 1; } // Compute barycentric-interpolated depth. Could also compute it incrementally. float depth = zz[0] + beta * zz[1] + gamma * zz[2];