mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-25 16:42:26 +00:00
render/vulkan: wait for device to become idle in vulkan_destroy()
It's not safe to destroy any resources which might still be in-use by the GPU. Wait for any asynchronous tasks to complete before destroying everything.
This commit is contained in:
parent
f4f3c15c1e
commit
d112c2d922
@ -1120,6 +1120,11 @@ static void vulkan_destroy(struct wlr_renderer *wlr_renderer) {
|
||||
|
||||
assert(!renderer->current_render_buffer);
|
||||
|
||||
VkResult res = vkDeviceWaitIdle(renderer->dev->dev);
|
||||
if (res != VK_SUCCESS) {
|
||||
wlr_vk_error("vkDeviceWaitIdle", res);
|
||||
}
|
||||
|
||||
// stage.cb automatically freed with command pool
|
||||
struct wlr_vk_shared_buffer *buf, *tmp_buf;
|
||||
wl_list_for_each_safe(buf, tmp_buf, &renderer->stage.buffers, link) {
|
||||
|
Loading…
Reference in New Issue
Block a user