mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 23:28:06 +02:00
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:
parent
5ee9a76058
commit
8916b8a7f4
1 changed files with 7 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue