diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2023-05-15 10:02:44 -0400 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-05-15 20:51:40 +0000 |
commit | 58532057c56bfecad38bf589ee17139ab5757306 (patch) | |
tree | cd71b12567038ce69b675c5cb9356aea8a4bc912 | |
parent | cd0454646fb07eb5cc673f3855d0e1c2b4c8032f (diff) | |
download | mesa-58532057c56bfecad38bf589ee17139ab5757306.tar.gz |
zink: destroy current batch state after all other batch states
some resources may not be destroyed immediately and may instead be
queued for deletion onto the current batch state, so ensure that the
current state is the last one to be destroyed so that all deferred resources
are also destroyed
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23033>
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 3595dc6e321..5a6f7a3dacc 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -150,10 +150,6 @@ zink_context_destroy(struct pipe_context *pctx) zink_descriptors_deinit_bindless(ctx); - if (ctx->batch.state) { - zink_clear_batch_state(ctx, ctx->batch.state); - zink_batch_state_destroy(screen, ctx->batch.state); - } struct zink_batch_state *bs = ctx->batch_states; while (bs) { struct zink_batch_state *bs_next = bs->next; @@ -168,6 +164,10 @@ zink_context_destroy(struct pipe_context *pctx) zink_batch_state_destroy(screen, bs); bs = bs_next; } + if (ctx->batch.state) { + zink_clear_batch_state(ctx, ctx->batch.state); + zink_batch_state_destroy(screen, ctx->batch.state); + } for (unsigned i = 0; i < 2; i++) { util_idalloc_fini(&ctx->di.bindless[i].tex_slots); |