From ac059f1c238ff8f9a6a1852ec9c89858e7276700 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 25 Jan 2017 00:09:24 +0100 Subject: radeonsi: use a bitmask for looping over dirty PM4 states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also move it to draw_vbo, because it should be 0 in most cases Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_pm4.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_pm4.c') diff --git a/src/gallium/drivers/radeonsi/si_pm4.c b/src/gallium/drivers/radeonsi/si_pm4.c index 97b6799f361..2680439d35e 100644 --- a/src/gallium/drivers/radeonsi/si_pm4.c +++ b/src/gallium/drivers/radeonsi/si_pm4.c @@ -29,8 +29,6 @@ #include "si_pipe.h" #include "sid.h" -#define NUMBER_OF_STATES (sizeof(union si_state) / sizeof(struct si_pm4_state *)) - void si_pm4_cmd_begin(struct si_pm4_state *state, unsigned opcode) { state->last_opcode = opcode; @@ -157,22 +155,10 @@ void si_pm4_emit(struct si_context *sctx, struct si_pm4_state *state) } } -void si_pm4_emit_dirty(struct si_context *sctx) -{ - for (int i = 0; i < NUMBER_OF_STATES; ++i) { - struct si_pm4_state *state = sctx->queued.array[i]; - - if (!state || sctx->emitted.array[i] == state) - continue; - - si_pm4_emit(sctx, state); - sctx->emitted.array[i] = state; - } -} - void si_pm4_reset_emitted(struct si_context *sctx) { memset(&sctx->emitted, 0, sizeof(sctx->emitted)); + sctx->dirty_states |= u_bit_consecutive(0, SI_NUM_STATES); } void si_pm4_upload_indirect_buffer(struct si_context *sctx, -- cgit v1.2.3