diff options
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); |