Skip to content
Permalink
Browse files

SoftGPU: Always clip, without special neg z case.

Depth clamping doesn't change whether it clips.  Also, avoid culling when
a vertex is behind the near plane.
  • Loading branch information...
unknownbrackets committed Aug 6, 2018
1 parent cd6b1f7 commit e22cc7ef6d057b4a7907f373ac3d2254609df57d
Showing with 2 additions and 14 deletions.
  1. +2 −14 GPU/Software/Clipper.cpp
@@ -256,13 +256,7 @@ void ProcessLine(VertexData& v0, VertexData& v1)
return;
}

if (mask && gstate.isDepthClampEnabled()) {
// TODO: Validate if this logic is correct / should be in depthClampEnabled.

// discard if any vertex is outside the near clipping plane
if (mask & CLIP_NEG_Z_BIT)
return;

if (mask) {
CLIP_LINE(CLIP_POS_X_BIT, -1, 0, 0, 1);
CLIP_LINE(CLIP_NEG_X_BIT, 1, 0, 0, 1);
CLIP_LINE(CLIP_POS_Y_BIT, 0, -1, 0, 1);
@@ -306,13 +300,7 @@ void ProcessTriangle(VertexData& v0, VertexData& v1, VertexData& v2)
mask |= CalcClipMask(v1.clippos);
mask |= CalcClipMask(v2.clippos);

if (mask && gstate.isDepthClampEnabled()) {
// TODO: Validate if this logic is correct / should be in depthClampEnabled.

// discard if any vertex is outside the near clipping plane
if (mask & CLIP_NEG_Z_BIT)
return;

if (mask) {
for (int i = 0; i < 3; i += 3) {
int vlist[2][2*6+1];
int *inlist = vlist[0], *outlist = vlist[1];

0 comments on commit e22cc7e

Please sign in to comment.
You can’t perform that action at this time.