From 8c3ae2f2441abcb277ee1a8307014d470ea29265 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 18 Nov 2023 22:31:10 -0800 Subject: [PATCH] overdraw: Remove redundant v2z/v3z swap v2z/v3z are unused in the rest of the function since we just rely on v1z and depth gradients from here on. We already avoided flipping them, so we also avoid swapping them. This fixes a few clang-tidy warnings. --- src/overdrawanalyzer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/overdrawanalyzer.cpp b/src/overdrawanalyzer.cpp index 8b6f254134..31cf6f146a 100644 --- a/src/overdrawanalyzer.cpp +++ b/src/overdrawanalyzer.cpp @@ -53,11 +53,10 @@ static void rasterize(OverdrawBuffer* buffer, float v1x, float v1y, float v1z, f // flip backfacing triangles to simplify rasterization logic if (sign) { - // flipping v2 & v3 preserves depth gradients since they're based on v1 + // flipping v2 & v3 preserves depth gradients since they're based on v1; only v1z is used below float t; t = v2x, v2x = v3x, v3x = t; t = v2y, v2y = v3y, v3y = t; - t = v2z, v2z = v3z, v3z = t; // flip depth since we rasterize backfacing triangles to second buffer with reverse Z; only v1z is used below v1z = kViewport - v1z;