diff --git a/.pick_status.json b/.pick_status.json index bf62f69e267..2a3385d609e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2632,7 +2632,7 @@ "description": "zink: destroy current batch state after all other batch states", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index e26cb658ec5..5ff6b4a1e61 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -149,10 +149,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; @@ -167,6 +163,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);