From 978d80fbe2ad83f8acdf6c9a3ae2486c10960c96 Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Sat, 27 May 2023 12:54:11 +0900 Subject: [PATCH] radv: Make shader related destruction happen before hw_ctx. radv_destroy_shader_upload_queue waits for a semaphore, which will in turn call query_reset_status on hw_ctx that will fail due to being already destroyed. Fix radv/amdgpu: amdgpu_cs_query_reset_state2 failed. (-9) spam in the logs with RADV_PERFTEST=dmashaders. Cc: mesa-stable Part-of: --- src/amd/vulkan/radv_device.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index c46b67f3997..a2b26ceaaa7 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1156,6 +1156,12 @@ radv_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator) _mesa_hash_table_destroy(device->rt_handles, NULL); + radv_device_finish_meta(device); + + vk_pipeline_cache_destroy(device->mem_cache, NULL); + + radv_destroy_shader_upload_queue(device); + for (unsigned i = 0; i < RADV_NUM_HW_CTX; i++) { if (device->hw_ctx[i]) device->ws->ctx_destroy(device->hw_ctx[i]); @@ -1166,12 +1172,6 @@ radv_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator) simple_mtx_destroy(&device->trace_mtx); simple_mtx_destroy(&device->rt_handles_mtx); - radv_device_finish_meta(device); - - vk_pipeline_cache_destroy(device->mem_cache, NULL); - - radv_destroy_shader_upload_queue(device); - radv_trap_handler_finish(device); radv_finish_trace(device);