mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01: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
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue