mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
softgpu: Simplify mask check.
This performs a bit better.
This commit is contained in:
parent
89bc87a388
commit
abef17caca
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user