diff options
author | Tim Rowley <timothy.o.rowley@intel.com> | 2016-06-01 09:56:26 -0500 |
---|---|---|
committer | Tim Rowley <timothy.o.rowley@intel.com> | 2016-06-07 11:47:52 -0500 |
commit | 87f0a0448fba898a7ab2a36eed9682ff8c1c6d5c (patch) | |
tree | 0b58bdbd4f96ec9c25a91e900bb4d916d448f40c /src/gallium/drivers/swr/swr_draw.cpp | |
parent | c81b090c920f90bf86a34c978e10ff336d1edbc0 (diff) | |
download | external_mesa3d-87f0a0448fba898a7ab2a36eed9682ff8c1c6d5c.zip external_mesa3d-87f0a0448fba898a7ab2a36eed9682ff8c1c6d5c.tar.gz external_mesa3d-87f0a0448fba898a7ab2a36eed9682ff8c1c6d5c.tar.bz2 |
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 <bruce.cherniak@intel.com>
Diffstat (limited to 'src/gallium/drivers/swr/swr_draw.cpp')
-rw-r--r-- | src/gallium/drivers/swr/swr_draw.cpp | 30 |
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 7a4c896..ab8d275 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); |