summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_draw.cpp
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-06-01 09:56:26 -0500
committerTim Rowley <[email protected]>2016-06-07 11:47:52 -0500
commit87f0a0448fba898a7ab2a36eed9682ff8c1c6d5c (patch)
tree0b58bdbd4f96ec9c25a91e900bb4d916d448f40c /src/gallium/drivers/swr/swr_draw.cpp
parentc81b090c920f90bf86a34c978e10ff336d1edbc0 (diff)
swr: fix provoking vertex
Use rasterizer provoking vertex API. Fix rasterizer provoking vertex for tristrips and quad list/strips. v2: make provoking vertex tables static const Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_draw.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_draw.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp
index 7a4c89626fb..ab8d2750623 100644
--- a/src/gallium/drivers/swr/swr_draw.cpp
+++ b/src/gallium/drivers/swr/swr_draw.cpp
@@ -162,6 +162,36 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
/* Set up frontend state
* XXX setup provokingVertex & topologyProvokingVertex */
SWR_FRONTEND_STATE feState = {0};
+ if (ctx->rasterizer->flatshade_first) {
+ feState.provokingVertex = {1, 0, 0};
+ } else {
+ feState.provokingVertex = {2, 1, 2};
+ }
+
+ switch (info->mode) {
+ case PIPE_PRIM_TRIANGLE_FAN:
+ feState.topologyProvokingVertex = feState.provokingVertex.triFan;
+ break;
+ case PIPE_PRIM_TRIANGLE_STRIP:
+ case PIPE_PRIM_TRIANGLES:
+ feState.topologyProvokingVertex = feState.provokingVertex.triStripList;
+ break;
+ case PIPE_PRIM_QUAD_STRIP:
+ case PIPE_PRIM_QUADS:
+ if (ctx->rasterizer->flatshade_first)
+ feState.topologyProvokingVertex = 0;
+ else
+ feState.topologyProvokingVertex = 3;
+ break;
+ case PIPE_PRIM_LINES:
+ case PIPE_PRIM_LINE_LOOP:
+ case PIPE_PRIM_LINE_STRIP:
+ feState.topologyProvokingVertex = feState.provokingVertex.lineStripList;
+ break;
+ default:
+ feState.topologyProvokingVertex = 0;
+ }
+
feState.bEnableCutIndex = info->primitive_restart;
SwrSetFrontendState(ctx->swrContext, &feState);