radeonsi: move si_pm4_delete_state logic into si_pm4_free_state

also clear dirty_states.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8794>
This commit is contained in:
Marek Olšák 2021-01-09 07:55:59 -05:00
parent b0bc5edfbd
commit d4b503d0bc
2 changed files with 9 additions and 8 deletions

View file

@ -99,8 +99,14 @@ void si_pm4_free_state(struct si_context *sctx, struct si_pm4_state *state, unsi
if (!state)
return;
if (idx != ~0 && sctx->emitted.array[idx] == state) {
sctx->emitted.array[idx] = NULL;
if (idx != ~0) {
if (sctx->emitted.array[idx] == state)
sctx->emitted.array[idx] = NULL;
if (sctx->queued.array[idx] == state) {
sctx->queued.array[idx] = NULL;
sctx->dirty_states &= ~BITFIELD_BIT(idx);
}
}
si_pm4_clear_state(state);

View file

@ -485,12 +485,7 @@ struct si_buffer_resources {
} while (0)
#define si_pm4_delete_state(sctx, member, value) \
do { \
if ((sctx)->queued.named.member == (value)) { \
(sctx)->queued.named.member = NULL; \
} \
si_pm4_free_state(sctx, (struct si_pm4_state *)(value), SI_STATE_IDX(member)); \
} while (0)
si_pm4_free_state(sctx, (struct si_pm4_state *)(value), SI_STATE_IDX(member))
/* si_descriptors.c */
void si_set_mutable_tex_desc_fields(struct si_screen *sscreen, struct si_texture *tex,