mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
SoftGPU: Clip lines entirely outside early.
Some were getting through, which may mean the line clipping isn't working so well...
This commit is contained in:
parent
672ce51a2a
commit
9d64597fb3
1 changed files with 5 additions and 4 deletions
|
@ -246,6 +246,11 @@ void ProcessLine(VertexData& v0, VertexData& v1)
|
|||
int mask1 = CalcClipMask(v1.clippos);
|
||||
int mask = mask0 | mask1;
|
||||
|
||||
if (mask0 & mask1) {
|
||||
// Even if clipping is disabled, we can discard if the line is entirely outside.
|
||||
return;
|
||||
}
|
||||
|
||||
if (mask && (gstate.clipEnable & 0x1)) {
|
||||
// discard if any vertex is outside the near clipping plane
|
||||
if (mask & CLIP_NEG_Z_BIT)
|
||||
|
@ -257,10 +262,6 @@ void ProcessLine(VertexData& v0, VertexData& v1)
|
|||
CLIP_LINE(CLIP_NEG_Y_BIT, 0, 1, 0, 1);
|
||||
CLIP_LINE(CLIP_POS_Z_BIT, 0, 0, 0, 1);
|
||||
CLIP_LINE(CLIP_NEG_Z_BIT, 0, 0, 1, 1);
|
||||
} else if (mask0 & mask1) {
|
||||
// If clipping is disabled, only discard the current primitive
|
||||
// if both vertices lie outside one of the clipping planes
|
||||
return;
|
||||
}
|
||||
|
||||
VertexData data[2] = { *Vertices[0], *Vertices[1] };
|
||||
|
|
Loading…
Add table
Reference in a new issue