- fixed bad clamp in software renderer

This one can have its upper bound below its lower bound which triggers the validation within std::clamp.

Fixes #2125
This commit is contained in:
Professor Hastig 2023-09-14 08:48:47 +02:00 committed by Rachael Alexanderson
parent 52ec2b2a5b
commit fbf7d1025a

View file

@ -108,7 +108,7 @@ namespace swrenderer
{ {
for (int j = x1; j < x2; ++j) for (int j = x1; j < x2; ++j)
{ {
down[j] = clamp(most3.ScreenY[j], up[j], dwal[j]); down[j] = max(min(most3.ScreenY[j], up[j]), dwal[j]); // this cannot use clamp due to failing range checks.
} }
ProcessNormalWall(up, down, texcoords); ProcessNormalWall(up, down, texcoords);
up = down; up = down;