-
Notifications
You must be signed in to change notification settings - Fork 519
Description
If a VkSwapchainPresentScalingCreateInfoKHR structure was not included in the pNext chain, or it is included and VkSwapchainPresentScalingCreateInfoKHR::scalingBehavior is zero then imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface
The min and max image extents obtained from vkGetPhysicalDeviceSurfaceCapabilitiesKHR may change before vkCreateSwapchainKHR is executed, and so there is no way to guarantee that the image extent within the limits at the time of the driver handling vkCreateSwapchainKHR.
This happens when resizing a window in X11 while rendering to it from a separate thread:
Requested image extent (1474x716) does not match surface (1456x542), marking swapchain out of date type=GENERAL id=4 name=NVIDIA
The above error occurs despite a fresh query of the surface capabilities and restricting the image extent to be within the returned limits.
Suggestion
Instead of letting this be invalid usage of the API, require the driver to return an error so the application can retry swapchain creation later.