zink: add some checks to determine whether queue is init on screen destroy

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663>
This commit is contained in:
Mike Blumenkrantz
2023-10-11 12:10:56 -04:00
committed by Marge Bot
parent 7a7e577d8e
commit 01f2aa846e

View File

@@ -1485,10 +1485,12 @@ zink_destroy_screen(struct pipe_screen *pscreen)
VKSCR(DestroyPipelineLayout)(screen->dev, screen->gfx_push_constant_layout, NULL);
u_transfer_helper_destroy(pscreen->transfer_helper);
util_queue_finish(&screen->cache_get_thread);
util_queue_destroy(&screen->cache_get_thread);
if (util_queue_is_initialized(&screen->cache_get_thread)) {
util_queue_finish(&screen->cache_get_thread);
util_queue_destroy(&screen->cache_get_thread);
}
#ifdef ENABLE_SHADER_CACHE
if (screen->disk_cache) {
if (screen->disk_cache && util_queue_is_initialized(&screen->cache_put_thread)) {
util_queue_finish(&screen->cache_put_thread);
disk_cache_wait_for_idle(screen->disk_cache);
util_queue_destroy(&screen->cache_put_thread);
@@ -1512,7 +1514,7 @@ zink_destroy_screen(struct pipe_screen *pscreen)
if (screen->fence)
VKSCR(DestroyFence)(screen->dev, screen->fence, NULL);
if (screen->threaded_submit)
if (util_queue_is_initialized(&screen->flush_queue))
util_queue_destroy(&screen->flush_queue);
simple_mtx_destroy(&screen->semaphores_lock);