X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fradeonsi%2Fsi_pm4.c;h=d1d003af1d4ddc86e8c12e04b3b386327db0b396;hp=f34462679706f2ee015fe359a6a8f68995f81207;hb=64349a60e17a03de4bb7e03d942bfc1679dfe8ab;hpb=95c9048591c6d3ccf597f73dfcde09028c7330c5 diff --git a/src/gallium/drivers/radeonsi/si_pm4.c b/src/gallium/drivers/radeonsi/si_pm4.c index f3446267970..d1d003af1d4 100644 --- a/src/gallium/drivers/radeonsi/si_pm4.c +++ b/src/gallium/drivers/radeonsi/si_pm4.c @@ -119,8 +119,23 @@ void si_pm4_emit(struct si_context *sctx, struct si_pm4_state *state) state->atom.emit(sctx); } -void si_pm4_reset_emitted(struct si_context *sctx) +void si_pm4_reset_emitted(struct si_context *sctx, bool first_cs) { + if (!first_cs && sctx->shadowed_regs) { + /* Only dirty states that contain buffers, so that they are + * added to the buffer list on the next draw call. + */ + for (unsigned i = 0; i < SI_NUM_STATES; i++) { + struct si_pm4_state *state = sctx->emitted.array[i]; + + if (state && state->shader) { + sctx->emitted.array[i] = NULL; + sctx->dirty_states |= 1 << i; + } + } + return; + } + memset(&sctx->emitted, 0, sizeof(sctx->emitted)); sctx->dirty_states |= u_bit_consecutive(0, SI_NUM_STATES); }