summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-08-20 16:18:23 +0100
committerKeith Whitwell <[email protected]>2010-08-25 10:29:27 +0100
commitc25151dd6a06acd93c8bf0d9e79fdcf134ffe818 (patch)
treede6c6c983b6eeb2521874f724b86e4d24f1d2ebb /src/gallium/drivers
parent98f3ff8f4a761d579ee9b42ee3090635519213a5 (diff)
llvmpipe: cull zero-area triangles early
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 614a6372b42..b4325390fe7 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -819,9 +819,10 @@ static void triangle_both( struct lp_setup_context *setup,
const float fy = v1[0][1] - v2[0][1];
/* det = cross(e,f).z */
- if (ex * fy - ey * fx < 0.0f)
+ const float det = ex * fy - ey * fx;
+ if (det < 0.0f)
triangle_ccw( setup, v0, v1, v2 );
- else
+ else if (det > 0.0f)
triangle_cw( setup, v0, v1, v2 );
}