From 0a9cec3475fb14be8aa5fa66557d338556cd8ed5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 24 Apr 2011 20:20:55 +1000 Subject: [PATCH] r600g: fix glean clipflat test. the provoking vertex doesn't apply to quad/strip/polygon. This fixes clipFlat on r600g. Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/r600_pipe.h | 1 - src/gallium/drivers/r600/r600_state_common.c | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 88aff0e81bb..40987a0e2de 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -241,7 +241,6 @@ int r600_find_vs_semantic_index(struct r600_shader *vs, /* r600_state.c */ void r600_init_state_functions(struct r600_pipe_context *rctx); -void r600_spi_update(struct r600_pipe_context *rctx); void r600_init_config(struct r600_pipe_context *rctx); void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader); void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader); diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 997c9a597ee..2f1068a0631 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -277,7 +277,7 @@ void r600_delete_vs_shader(struct pipe_context *ctx, void *state) } /* FIXME optimize away spi update when it's not needed */ -void r600_spi_update(struct r600_pipe_context *rctx) +static void r600_spi_update(struct r600_pipe_context *rctx, unsigned prim) { struct r600_pipe_shader *shader = rctx->ps_shader; struct r600_pipe_state rstate; @@ -309,6 +309,12 @@ void r600_spi_update(struct r600_pipe_context *rctx) r600_pipe_state_add_reg(&rstate, R_028644_SPI_PS_INPUT_CNTL_0 + i * 4, tmp, 0xFFFFFFFF, NULL); } + + if (prim == PIPE_PRIM_QUADS || prim == PIPE_PRIM_QUAD_STRIP || prim == PIPE_PRIM_POLYGON) { + r600_pipe_state_add_reg(&rstate, R_028814_PA_SU_SC_MODE_CNTL, + S_028814_PROVOKING_VTX_LAST(1), + S_028814_PROVOKING_VTX_LAST(1), NULL); + } r600_context_pipe_state_set(&rctx->ctx, &rstate); } @@ -508,7 +514,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) return; } - r600_spi_update(rctx); + r600_spi_update(rctx, draw.info.mode); mask = 0; for (int i = 0; i < rctx->framebuffer.nr_cbufs; i++) { -- 2.30.2