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>
(cherry picked from commit 978d80fbe2)
This commit is contained in:
Tatsuyuki Ishi 2023-05-27 12:54:11 +09:00 committed by Eric Engestrom
parent 805a3219ec
commit 16d8815c09
2 changed files with 7 additions and 7 deletions

View file

@ -2074,7 +2074,7 @@
"description": "radv: Make shader related destruction happen before hw_ctx.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -1166,6 +1166,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]);
@ -1176,12 +1182,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);