From 5d44a973b537515b0f853f54bec9925705badba1 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 15 Dec 2020 10:35:32 +0100 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/zink/zink_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 20521d59e92..52bfd970c9f 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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); }