From 8ea0b00a75bdd56bd2be90b3f7b1c7327f45872a Mon Sep 17 00:00:00 2001 From: Antonino Maniscalco Date: Wed, 25 Jun 2025 19:24:23 +0200 Subject: [PATCH] zink: wait for sparse queue to go idle When destroying the context we should also wait for the sparse queue to go idle. cc: mesa-stable Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_context.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index c7b96ad5ab6..257ad0de87a 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -138,6 +138,15 @@ zink_context_destroy(struct pipe_context *pctx) if (result != VK_SUCCESS) mesa_loge("ZINK: vkQueueWaitIdle failed (%s)", vk_Result_to_str(result)); + + if (screen->queue_sparse && screen->queue_sparse != screen->queue) { + simple_mtx_lock(&screen->queue_lock); + VkResult result = VKSCR(QueueWaitIdle)(screen->queue_sparse); + simple_mtx_unlock(&screen->queue_lock); + + if (result != VK_SUCCESS) + mesa_loge("ZINK: vkQueueWaitIdle failed (%s)", vk_Result_to_str(result)); + } } for (unsigned i = 0; i < ARRAY_SIZE(ctx->program_cache); i++) {