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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23276>
This commit is contained in:
Tatsuyuki Ishi 2023-05-27 12:54:11 +09:00 committed by Marge Bot
parent 01bd012edd
commit 978d80fbe2

View file

@ -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);