vulkan/wsi: update swapchain status on vkQueuePresent
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 15 Jul 2019 06:01:20 +0000 (09:01 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 17 Jul 2019 14:40:54 +0000 (17:40 +0300)
commit6f880f128f9862a047a5ba543c2843e14517b1e6
treebf3353d4faf558c45d4cb81aca8bd1698ed2fa8a
parent24b1b1f5745d14865d1e1947a8882d5ed58470b4
vulkan/wsi: update swapchain status on vkQueuePresent

With the following chain of events :

   vkQueuePresent()
   <- Surface resize
   vkQueuePresent()

We should be able to report SUBOPTIMAL or OUT_OF_DATE on the second
vkQueuePresent() call. Currently we only look at X11 events in the
vkAcquireNextImage() path so we're not able to report this.

This change checks the queue of events and process any available ones
to update the swapchain status.

v2: Be consistent about reporting the current error state of the
    swapchain (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111097
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/vulkan/wsi/wsi_common_x11.c