summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw/draw_clip.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-30 14:31:42 -0600
committerBrian <[email protected]>2007-08-30 14:43:08 -0600
commitaaf03b94861cbf5a602863e4542dd1c2e54ba365 (patch)
tree853b15984f8ebfb0f60ed1aa83ce7f3a5eedd384 /src/mesa/pipe/draw/draw_clip.c
parent2d187672b7e38fcd8f6caa93f35dceb6fa11aa7f (diff)
Fix lost edge flags problem when clipping.
In emit_poly() we need to compute header.edgeflags from the vertex edge flags. Also need to set header.det so later stages can determine front/back orientation.
Diffstat (limited to 'src/mesa/pipe/draw/draw_clip.c')
-rw-r--r--src/mesa/pipe/draw/draw_clip.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/pipe/draw/draw_clip.c b/src/mesa/pipe/draw/draw_clip.c
index a23b7a28109..1396b60f45e 100644
--- a/src/mesa/pipe/draw/draw_clip.c
+++ b/src/mesa/pipe/draw/draw_clip.c
@@ -177,11 +177,15 @@ static INLINE void do_tri( struct draw_stage *next,
static void emit_poly( struct draw_stage *stage,
struct vertex_header **inlist,
- unsigned n )
+ unsigned n,
+ const struct prim_header *origPrim)
{
struct prim_header header;
unsigned i;
+ /* later stages may need the determinant, but only the sign matters */
+ header.det = origPrim->det;
+
for (i = 2; i < n; i++) {
header.v[0] = inlist[0];
header.v[1] = inlist[i-1];
@@ -194,6 +198,10 @@ static void emit_poly( struct draw_stage *stage,
if (i != 2) header.v[0]->edgeflag = 0;
if (i != n-1) header.v[2]->edgeflag = 0;
+ header.edgeflags = ((header.v[0]->edgeflag << 0) |
+ (header.v[1]->edgeflag << 1) |
+ (header.v[2]->edgeflag << 2));
+
stage->next->tri( stage->next, &header );
header.v[0]->edgeflag = tmp0;
@@ -302,7 +310,7 @@ do_clip_tri( struct draw_stage *stage,
/* Emit the polygon as triangles to the setup stage:
*/
if (n >= 3)
- emit_poly( stage, inlist, n );
+ emit_poly( stage, inlist, n, header );
}