vulkan/wsi: Handle 0xFFFFFFFF special case in vk_wsi_force_swapchain_to_current_extent driconf

Current extent can be 0xFFFFFFFF (-1) which indicates there is no current extent, and the swapchain will inherit that of which the application provides.

Check this before applying the hack.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31134>
This commit is contained in:
Joshua Ashton 2024-09-11 21:19:27 +01:00 committed by Marge Bot
parent 5ee9a76058
commit 8916b8a7f4

View file

@ -1050,7 +1050,13 @@ wsi_CreateSwapchainKHR(VkDevice _device,
.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
};
iface->get_capabilities2(surface, wsi_device, NULL, &caps2);
info.imageExtent = caps2.surfaceCapabilities.currentExtent;
/* 0xffffffff (UINT32_MAX) indicates that the surface has no intrinsic extent, so the size of the
* surface will be the size of the swapchain. In this case, overriding the swapchain size makes
* no sense.
*/
if (caps2.surfaceCapabilities.currentExtent.width != UINT32_MAX)
info.imageExtent = caps2.surfaceCapabilities.currentExtent;
}
/* Ignore DEFERRED_MEMORY_ALLOCATION_BIT. Would require deep plumbing to be able to take advantage of it.