From 11a853e912c73b65f6b877e4fbca904b54f3da41 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 2 May 2023 13:31:37 +0200 Subject: [PATCH] wsi/wayland: Do not assert that all present IDs have been waited on. EXT_swapchain_maintenance1 allows destruction when the swapchain fence is complete. That may signal before we have dispatched all present waits. Just discard those presentation feedbacks. Signed-off-by: Hans-Kristian Arntzen Reviewed-by: Joshua Ashton Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index d2ec332f967..46b700cd4e6 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -2118,7 +2118,17 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, if (chain->present_ids.wp_presentation) { assert(!chain->present_ids.dispatch_in_progress); - assert(wl_list_empty(&chain->present_ids.outstanding_list)); + + /* In VK_EXT_swapchain_maintenance1 there is no requirement to wait for all present IDs to be complete. + * Waiting for the swapchain fence is enough. + * Just clean up anything user did not wait for. */ + struct wsi_wl_present_id *id, *tmp; + wl_list_for_each_safe(id, tmp, &chain->present_ids.outstanding_list, link) { + wp_presentation_feedback_destroy(id->feedback); + wl_list_remove(&id->link); + vk_free(id->alloc, id); + } + wl_proxy_wrapper_destroy(chain->present_ids.wp_presentation); pthread_cond_destroy(&chain->present_ids.list_advanced); pthread_mutex_destroy(&chain->present_ids.lock);