Module: Mesa Branch: master Commit: d81126b714cd4de0ab036bb22bf4103f5fcec015 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d81126b714cd4de0ab036bb22bf4103f5fcec015
Author: Vadim Girlin <vadimgir...@gmail.com> Date: Fri Jun 24 20:29:12 2011 +0400 r600g: optimize spi update Signed-off-by: Vadim Girlin <vadimgir...@gmail.com> --- 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 9941bbf..63ddd39 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -202,6 +202,7 @@ struct r600_pipe_context { struct pipe_query *saved_render_cond; unsigned saved_render_cond_mode; /* shader information */ + boolean spi_dirty; unsigned sprite_coord_enable; boolean flatshade; boolean export_16bpc; diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 30c6181..259f426 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -112,7 +112,7 @@ void r600_bind_rs_state(struct pipe_context *ctx, void *state) r600_polygon_offset_update(rctx); } if (rctx->ps_shader && rctx->vs_shader) - r600_spi_update(rctx); + rctx->spi_dirty = true; } void r600_delete_rs_state(struct pipe_context *ctx, void *state) @@ -274,7 +274,7 @@ void r600_bind_ps_shader(struct pipe_context *ctx, void *state) r600_context_pipe_state_set(&rctx->ctx, &rctx->ps_shader->rstate); } if (rctx->ps_shader && rctx->vs_shader) { - r600_spi_update(rctx); + rctx->spi_dirty = true; r600_adjust_gprs(rctx); } } @@ -289,7 +289,7 @@ void r600_bind_vs_shader(struct pipe_context *ctx, void *state) r600_context_pipe_state_set(&rctx->ctx, &rctx->vs_shader->rstate); } if (rctx->ps_shader && rctx->vs_shader) { - r600_spi_update(rctx); + rctx->spi_dirty = true; r600_adjust_gprs(rctx); } } @@ -391,6 +391,7 @@ static void r600_spi_update(struct r600_pipe_context *rctx) r600_pipe_state_mod_reg(rstate, tmp); } + rctx->spi_dirty = false; r600_context_pipe_state_set(&rctx->ctx, rstate); } @@ -573,6 +574,9 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) if (r600_conv_pipe_prim(draw.info.mode, &prim)) return; + if (rctx->spi_dirty) + r600_spi_update(rctx); + if (rctx->alpha_ref_dirty) r600_update_alpha_ref(rctx); _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit