softgpu: Fix depth cull in softgpu.
Was improperly skipping cull for positive Z.
This commit is contained in:
parent
fe440d40e5
commit
8db2d37e64
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue