From f29f656530a2b35574fbeb8623d9d141dec07d80 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Wed, 8 Feb 2023 13:36:54 +0100 Subject: [PATCH] vulkan/wsi/wayland: fix acquire_next_image to report timeouts properly The Vulkan Specification states about possible return values from vkAcquireNextImageKHR: * VK_NOT_READY is returned if timeout is zero and no image was available. * VK_TIMEOUT is returned if timeout is greater than zero and less than UINT64_MAX, and no image beae available within the time allowed. That is, if info->timeout is larger than zero, the function must return VK_TIMEOUT instead of VK_NOT_READY if no image became available before the timeout elapsed. Signed-off-by: Philipp Zabel Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 7d42c812476..928ec216505 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -1497,7 +1497,7 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, struct timespec current_time; clock_gettime(CLOCK_MONOTONIC, ¤t_time); if (timespec_after(¤t_time, &end_time)) - return VK_NOT_READY; + return (info->timeout ? VK_TIMEOUT : VK_NOT_READY); /* Try to read events from the server. */ ret = wl_display_prepare_read_queue(wsi_wl_surface->display->wl_display,