Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/w renderer convert few evaluations into compile time expressions. #1055

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Draw/SWImageRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -995,7 +995,7 @@ namespace spades {
}

float *const depthBuffer = r.depthBuffer;
if (depthTest) {
if constexpr(depthTest) {
SPAssert(depthBuffer != nullptr);
}

Expand Down Expand Up @@ -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;
}
Expand Down