Commit 0245b825 authored by Niklas Haas's avatar Niklas Haas Committed by Marge Bot
Browse files

vulkan/wsi/x11: lower resize events to VK_SUBOPTIMAL_KHR



Currently, a resized window results in an VK_ERROR_OUT_OF_DATE_KHR. But,
this seems to go against the spec, which suggests returning
VK_SUBOPTIMAL_KHR if the surface extent no longer matches the window
extent. (It does not *require* the WSI actually scale the contents, only
encourages doing so "if possible")

More to the point, VK_SUBOPTIMAL_KHR is the correct status to return if
the client *can* continue presenting to this swapchain, even if the
result will look wrong / "suboptimal". It's the client's decision on
when exactly to recreate the swapchain in this case, and the client may
very well end up wanting to continue presenting for a frame or two, to
prevent flooding the driver with swapchain recreations (which can result
in the window appearing visually "frozen" while resizing).

This change makes live resizing *significantly* smoother in e.g. mpv.
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Part-of: <!3196>
parent 4a1f230e
......@@ -893,7 +893,7 @@ x11_handle_dri3_present_event(struct x11_swapchain *chain,
if (config->width != chain->extent.width ||
config->height != chain->extent.height)
return VK_ERROR_OUT_OF_DATE_KHR;
return VK_SUBOPTIMAL_KHR;
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment