zink: destroy blitter before destroying batches

Destroying the blitter frees samplers, which pushes the sampler-handles
onto the batches' zombie-sampler lists. So if we want to properly clean
these zombie-samplers up, we need to first get them onto the list so
we'll know about them in time.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099>
This commit is contained in:
Erik Faye-Lund 2020-12-15 10:35:32 +01:00 committed by Marge Bot
parent 820d272a21
commit 5d44a973b5
1 changed files with 2 additions and 1 deletions

View File

@ -59,6 +59,8 @@ zink_context_destroy(struct pipe_context *pctx)
if (vkQueueWaitIdle(ctx->queue) != VK_SUCCESS)
debug_printf("vkQueueWaitIdle failed\n");
util_blitter_destroy(ctx->blitter);
for (unsigned i = 0; i < ARRAY_SIZE(ctx->null_buffers); i++)
pipe_resource_reference(&ctx->null_buffers[i], NULL);
@ -71,7 +73,6 @@ zink_context_destroy(struct pipe_context *pctx)
util_primconvert_destroy(ctx->primconvert);
u_upload_destroy(pctx->stream_uploader);
slab_destroy_child(&ctx->transfer_pool);
util_blitter_destroy(ctx->blitter);
FREE(ctx);
}