From 04bc5add8c5ccbe9e5bc07c49758ad5173340cbe Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 11 Dec 2022 21:25:52 +0000 Subject: [PATCH] s/w renderer convert few evaluations into compile time expressions. --- Sources/Draw/SWImageRenderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Draw/SWImageRenderer.cpp b/Sources/Draw/SWImageRenderer.cpp index d46e45d0d..b852c7e83 100644 --- a/Sources/Draw/SWImageRenderer.cpp +++ b/Sources/Draw/SWImageRenderer.cpp @@ -351,7 +351,7 @@ namespace spades { auto drawPixel = [mulR, mulG, mulB, mulA](uint32_t &dest, float &destDepth, uint32_t texture, float inDepth) { - if (depthTest) { + if constexpr(depthTest) { if (inDepth > destDepth) { return; } @@ -995,7 +995,7 @@ namespace spades { } float *const depthBuffer = r.depthBuffer; - if (depthTest) { + if constexpr(depthTest) { SPAssert(depthBuffer != nullptr); } @@ -1034,7 +1034,7 @@ namespace spades { mulCol = _mm_slli_epi16(mulCol, 8); auto drawPixel = [mulCol, mulInv](uint32_t &dest, float &destDepth, float inDepth) { - if (depthTest) { + if constexpr (depthTest) { if (inDepth > destDepth) { return; }