From 8006179cfdc15d6b012b25c5685a04fafe464459 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 24 Mar 2022 10:49:16 -0400 Subject: [PATCH] wsi/x11: xcb_wait_for_special_event failure is an error The only ways that function can return NULL are: - the xcb connection was closed - the window for the swapchain was destroyed - the special event listener was unregistered from another thread - malloc failure All of these are permanent errors, the swapchain is no longer in a usable state, so we should treat this as VK_ERROR_SURFACE_LOST_KHR. Acked-by: Jason Ekstrand Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 8f5ba92ef4f..563bf13f8c9 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -1106,7 +1106,7 @@ x11_acquire_next_image_poll_x11(struct x11_swapchain *chain, if (timeout == UINT64_MAX) { event = xcb_wait_for_special_event(chain->conn, chain->special_event); if (!event) - return x11_swapchain_result(chain, VK_ERROR_OUT_OF_DATE_KHR); + return x11_swapchain_result(chain, VK_ERROR_SURFACE_LOST_KHR); } else { event = xcb_poll_for_special_event(chain->conn, chain->special_event); if (!event) { @@ -1465,7 +1465,7 @@ x11_manage_fifo_queues(void *state) xcb_generic_event_t *event = xcb_wait_for_special_event(chain->conn, chain->special_event); if (!event) { - result = VK_ERROR_OUT_OF_DATE_KHR; + result = VK_ERROR_SURFACE_LOST_KHR; goto fail; } -- 2.34.1