nvk: Call vk_device_finish() last in nvk_DestroyDevice()

We initialize it first so we should destroy it last.  Otherwise, things
we call in our own destroy code might reference a dead vk_device and
blow up.

Fixes: d2ea532528 ("vulkan: Use syncobj shim")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34444>
This commit is contained in:
Faith Ekstrand
2025-04-09 18:12:58 -05:00
committed by Marge Bot
parent f0cfc1bbdc
commit a441bd3c7e
+2 -1
View File
@@ -324,7 +324,6 @@ nvk_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator)
nvk_queue_finish(dev, &dev->queue);
if (dev->vab_memory)
nvkmd_mem_unref(dev->vab_memory);
vk_device_finish(&dev->vk);
/* Idle the upload queue before we tear down heaps */
nvk_upload_queue_sync(dev, &dev->upload);
@@ -340,6 +339,8 @@ nvk_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator)
nvkmd_mem_unref(dev->zero_page);
nvk_upload_queue_finish(dev, &dev->upload);
nvkmd_dev_destroy(dev->nvkmd);
vk_device_finish(&dev->vk);
vk_free(&dev->vk.alloc, dev);
}