diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2008-04-24 12:38:15 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2008-04-24 12:39:09 +0100 |
commit | f93332da5655a31b6c44a1079629a15360ff999b (patch) | |
tree | 0e0a706c9dfbfae5dca184a286b01c6d340a5109 /src/gallium/auxiliary/draw/draw_pt_fetch.c | |
parent | dddedd915afb58ab6b87492e850baeadc007fe47 (diff) |
draw: handle edgeflags and reset-line-stipple again
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_fetch.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index cc61b113fd..9f74806e11 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -41,6 +41,7 @@ struct pt_fetch { struct translate *translate; unsigned vertex_size; + boolean need_edgeflags; struct translate_cache *cache; }; @@ -121,6 +122,10 @@ void draw_pt_fetch_prepare( struct pt_fetch *fetch, 0); } } + + fetch->need_edgeflags = ((draw->rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL || + draw->rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL) && + draw->pt.user.edgeflag); } @@ -147,6 +152,18 @@ void draw_pt_fetch_run( struct pt_fetch *fetch, elts, count, verts ); + + /* Edgeflags are hard to fit into a translate program, populate + * them separately if required. In the setup above they are + * defaulted to one, so only need this if there is reason to change + * that default: + */ + if (fetch->need_edgeflags) { + for (i = 0; i < count; i++) { + struct vertex_header *vh = (struct vertex_header *)(verts + i * fetch->vertex_size); + vh->edgeflag = draw_pt_get_edgeflag( draw, elts[i] ); + } + } } |