1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-20 06:46:55 +00:00
mpv/video/out/vulkan
llyyr d2f3b66439 vulkan: don't tolerate suboptimal swapchain configurations
The comment was probably only ever true for x11, and it currently isn't
true anymore. X11 WSI used to return VK_SUBOPTIMAL_KHR in
vkQueuePresentKHR and vkAcquireNextImageKHR before, but as of
2b885b233f
it only returns VK_SUBOPTIMAL_KHR in vkAcquireNextImageKHR for
performance reasons. This makes it so that we don't have to tolerate
suboptimal swapchain configurations for the sake of smoother resizing.

On top of that, not recreating swapchain when it was suboptimal, it
also prevented mpv from being directly scanned out when fullscreened on
Wayland compositors. On Wayland, the preferred modifier from the wsi
may change depending on whether the window is fullscreened or not for
direct scan out. If mpv is fullscreened but not using modifiers that
can be directly scanned out, mpv will be receive VK_SUBOPTIMAL_KHR from
WSI and should recreate swapchain to use the right modifier with the
format mpv picked. mpv will always get the format it picks, WSI can't
give us a different format. This allows for recreating the swapchain
with modifiers that will allow mpv to be directly scanned out when the
window is fullscreened spanning an output on Wayland.

I checked X11 and Wayland myself to have no regressions when resizing,
and others have checked Windows and Mac to have no regressions.

With this, direct scanout with Vulkan on Wayland should just work.
You might also need https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31122
if your compositor enables explicit syncronization via
linux-drm-syncobj-v1.
2024-09-14 16:16:35 +02:00
..
common.h mac/vulkan: remove old deprecated VK_MVK_macos_surface extension remains 2024-02-29 14:06:14 +01:00
context_android.c various: add GPU context description 2024-04-18 16:28:21 +02:00
context_display.c vulkan/context_display: don't fake avalibity of callbacks 2024-08-27 01:27:39 +02:00
context_mac.m mac/vulkan: error out on context creation without an NSApplication 2024-07-16 11:20:40 +02:00
context_wayland.c options: move all wayland specific options to vo_opts 2024-07-24 18:46:04 +00:00
context_win.c various: add GPU context description 2024-04-18 16:28:21 +02:00
context_xlib.c various: add GPU context description 2024-04-18 16:28:21 +02:00
context.c vulkan: don't tolerate suboptimal swapchain configurations 2024-09-14 16:16:35 +02:00
context.h vf_gpu: vulkan and egl implementations 2024-04-27 01:08:22 +02:00
utils.c vulkan: fix build error for 32bit builds with clang 2023-01-08 16:09:01 +01:00
utils.h vo_gpu: vulkan: use libplacebo instead 2019-04-21 23:55:22 +03:00