Skip to content
  • Niklas Haas's avatar
    vulkan/wsi/x11: lower resize events to VK_SUBOPTIMAL_KHR · 0245b825
    Niklas Haas authored
    
    
    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: default avatarAdam Jackson <ajax@redhat.com>
    Part-of: <mesa/mesa!3196>
    0245b825