Mesa (master): r600g: only make constant buffers dirty if there' s something to update

Marek Olšák mareko at kemper.freedesktop.org
Tue Jul 17 19:56:23 UTC 2012


Module: Mesa
Branch: master
Commit: 7022f49b52cb8b414a3716a08deb741cce9ed75c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7022f49b52cb8b414a3716a08deb741cce9ed75c

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat Jul 14 18:15:29 2012 +0200

r600g: only make constant buffers dirty if there's something to update

---

 src/gallium/drivers/r600/r600_state_common.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 23adf3b..f1d5d57 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -757,10 +757,12 @@ static void r600_update_alpha_ref(struct r600_context *rctx)
 
 void r600_constant_buffers_dirty(struct r600_context *rctx, struct r600_constbuf_state *state)
 {
-	r600_inval_shader_cache(rctx);
-	state->atom.num_dw = rctx->chip_class >= EVERGREEN ? util_bitcount(state->dirty_mask)*20
-							   : util_bitcount(state->dirty_mask)*19;
-	r600_atom_dirty(rctx, &state->atom);
+	if (state->dirty_mask) {
+		r600_inval_shader_cache(rctx);
+		state->atom.num_dw = rctx->chip_class >= EVERGREEN ? util_bitcount(state->dirty_mask)*20
+								   : util_bitcount(state->dirty_mask)*19;
+		r600_atom_dirty(rctx, &state->atom);
+	}
 }
 
 void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index,




More information about the mesa-commit mailing list