summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_setup.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-05 18:19:06 -0600
committerBrian Paul <brianp@vmware.com>2010-05-05 18:19:06 -0600
commitcb136a93aba4dc64db7e446b0fbc36c9172e4017 (patch)
treef899c682980b4af56e4dd0c7cd2d08cefb4efce3 /src/gallium/drivers/softpipe/sp_setup.c
parenta8bb49562938e94459f398a1733a76eb9c690f6c (diff)
downloadexternal_mesa3d-cb136a93aba4dc64db7e446b0fbc36c9172e4017.zip
external_mesa3d-cb136a93aba4dc64db7e446b0fbc36c9172e4017.tar.gz
external_mesa3d-cb136a93aba4dc64db7e446b0fbc36c9172e4017.tar.bz2
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/drivers/softpipe/sp_setup.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index 8635466..35ef9e6 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -304,7 +304,10 @@ setup_sort_vertices(struct setup_context *setup,
const float (*v1)[4],
const float (*v2)[4])
{
- setup->vprovoke = v2;
+ if (setup->softpipe->rasterizer->flatshade_first)
+ setup->vprovoke = v0;
+ else
+ setup->vprovoke = v2;
/* determine bottom to top order of vertices */
{