softgpu: Fix depth cull in softgpu.

Was improperly skipping cull for positive Z.
This commit is contained in:
Unknown W. Brackets 2021-11-05 21:38:13 -07:00
parent fe440d40e5
commit 8db2d37e64

View File

@ -30,6 +30,7 @@ namespace Clipper {
enum {
SKIP_FLAG = -1,
CLIP_POS_Z_BIT = 0x10,
CLIP_NEG_Z_BIT = 0x20,
};
@ -37,6 +38,7 @@ static inline int CalcClipMask(const ClipCoords& v)
{
int mask = 0;
// This checks `x / w` compared to 1 or -1, skipping the division.
if (v.z > v.w) mask |= CLIP_POS_Z_BIT;
if (v.z < -v.w) mask |= CLIP_NEG_Z_BIT;
return mask;
}