diff --git a/GPU/Software/Clipper.cpp b/GPU/Software/Clipper.cpp index 2a2a53b28a..f07f64614e 100644 --- a/GPU/Software/Clipper.cpp +++ b/GPU/Software/Clipper.cpp @@ -31,17 +31,14 @@ namespace Clipper { enum { SKIP_FLAG = -1, - CLIP_POS_Z_BIT = 0x10, CLIP_NEG_Z_BIT = 0x20, }; -static inline int CalcClipMask(const ClipCoords& v) -{ - int mask = 0; +static inline int CalcClipMask(const ClipCoords &v) { // 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; + if (v.z < -v.w) + return -1; + return 0; } inline bool different_signs(float x, float y) {