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 <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21190>
This commit is contained in:
Philipp Zabel 2023-02-08 13:36:54 +01:00 committed by Marge Bot
parent 75ccf7c003
commit f29f656530

View file

@ -1497,7 +1497,7 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain,
struct timespec current_time;
clock_gettime(CLOCK_MONOTONIC, &current_time);
if (timespec_after(&current_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,