mesa/src/vulkan/wsi
Chia-I Wu 206fe780d5 vulkan/wsi/x11: do not inherit last_present_mode
Under XWayland, the first present after a window resize is sometimes
completed with COPY (seems to happen when the previous present with the
old size is pending; not really sure).  The following presents are
completed with FLIP.

When a swapchain is created with an old swapchain, and
old_chain->last_present_mode is FLIP, chain->last_present_mode is set to
FLIP as well.  This causes the new swapchain to be marked
VK_SUBOPTIMAL_KHR, which is sticky, if the first present is completed
with COPY.

Instead of inheriting, treat each swapchain as independent.  We will
miss the case where an old swapchain is flipping but a new swapchain is
copying.  But swapchain reallocation normally happens in response to
present engine state change.  If the newly allocated swapchain is
copying, another reallocation is unlikely to fix that.

Fixes: 61309c2a72 ("vulkan/wsi/x11: Return VK_SUBOPTIMAL_KHR for X11")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12030>
2021-07-28 01:05:50 +00:00
..
meson.build vulkan: implement wsi_win32 backend 2021-02-25 03:41:36 +00:00
wsi_common.c vulkan: implement wsi_win32 backend 2021-02-25 03:41:36 +00:00
wsi_common.h vulkan/wsi: replace prime_blit_buffer by a bool 2021-07-23 15:31:20 -07:00
wsi_common_display.c vulkan/wsi: Implement VK_EXT_acquire_drm_display 2021-06-24 15:48:38 +00:00
wsi_common_display.h vulkan/wsi: Implement VK_EXT_acquire_drm_display 2021-06-24 15:48:38 +00:00
wsi_common_drm.c vulkan/wsi: replace prime_blit_buffer by a bool 2021-07-23 15:31:20 -07:00
wsi_common_private.h vulkan: implement wsi_win32 backend 2021-02-25 03:41:36 +00:00
wsi_common_queue.h
wsi_common_wayland.c wl/shm: don't fetch formats if not requested. 2021-07-20 05:03:04 +10:00
wsi_common_wayland.h
wsi_common_win32.c vulkan: allocate host-visible memory for swapchain images 2021-07-14 07:09:38 +00:00
wsi_common_win32.h vulkan: implement wsi_win32 backend 2021-02-25 03:41:36 +00:00
wsi_common_x11.c vulkan/wsi/x11: do not inherit last_present_mode 2021-07-28 01:05:50 +00:00
wsi_common_x11.h vulkan: drop always-true param 2018-10-26 18:33:11 +01:00