Skip to content

Commit 8c3ae2f

Browse files
committed
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.
1 parent f95a0bb commit 8c3ae2f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/overdrawanalyzer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ static void rasterize(OverdrawBuffer* buffer, float v1x, float v1y, float v1z, f
5353
// flip backfacing triangles to simplify rasterization logic
5454
if (sign)
5555
{
56-
// flipping v2 & v3 preserves depth gradients since they're based on v1
56+
// flipping v2 & v3 preserves depth gradients since they're based on v1; only v1z is used below
5757
float t;
5858
t = v2x, v2x = v3x, v3x = t;
5959
t = v2y, v2y = v3y, v3y = t;
60-
t = v2z, v2z = v3z, v3z = t;
6160

6261
// flip depth since we rasterize backfacing triangles to second buffer with reverse Z; only v1z is used below
6362
v1z = kViewport - v1z;

0 commit comments

Comments
 (0)