diff options
author | Brian Paul <brianp@vmware.com> | 2010-05-05 18:19:06 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-05-05 18:19:06 -0600 |
commit | cb136a93aba4dc64db7e446b0fbc36c9172e4017 (patch) | |
tree | f899c682980b4af56e4dd0c7cd2d08cefb4efce3 /src/gallium/auxiliary/draw/draw_pipe_vbuf.c | |
parent | a8bb49562938e94459f398a1733a76eb9c690f6c (diff) |
gallium: rework provoking vertex code
Builds on commit ddb0e18f6c5582d4d2cc59ffd16ad9c4639ed059 and fixes
regressions in glean clipFlat test.
We assume that Gallium drivers observe flatshade_first for all triangles
and that all the assorted per-triangle calls in the 'draw' module also
follow flatshade_first. Everything else builds on those rules.
Gallium does not use follow flatshade_first for GL quads, quad strips
and polygons; the "last" vertex is always the provoking vertex for those
prims. So now there are separate QUAD_FIRST_PV and QUAD_LAST_PV macros
in the draw primitive decomposition code instead of one QUAD macro.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_vbuf.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_vbuf.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c index abbf6247ab..1fd083e54d 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c +++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c @@ -159,19 +159,8 @@ vbuf_tri( struct draw_stage *stage, check_space( vbuf, 3 ); - if (vbuf->stage.draw->rasterizer->flatshade_first) { - /* Put provoking vertex in position expected by the driver. - * Emit last provoking vertex in first pos. - * Swap verts 0 & 1 to preserve polygon winding. - */ - vbuf->indices[vbuf->nr_indices++] = emit_vertex( vbuf, prim->v[2] ); - vbuf->indices[vbuf->nr_indices++] = emit_vertex( vbuf, prim->v[0] ); - vbuf->indices[vbuf->nr_indices++] = emit_vertex( vbuf, prim->v[1] ); - } - else { - for (i = 0; i < 3; i++) { - vbuf->indices[vbuf->nr_indices++] = emit_vertex( vbuf, prim->v[i] ); - } + for (i = 0; i < 3; i++) { + vbuf->indices[vbuf->nr_indices++] = emit_vertex( vbuf, prim->v[i] ); } } |