summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/zink/zink_context.c8
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);