To query the supported swapchain format tuples for a surface, call:
VkResult vkGetPhysicalDeviceSurfaceFormats2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats);
physicalDeviceis the physical device that will be associated with the swapchain to be created, as described for vkCreateSwapchainKHR.
pSurfaceFormatCountis a pointer to an integer related to the number of format tuples available or queried, as described below.
NULLor a pointer to an array of VkSurfaceFormat2KHR structures.
NULL, then the number of format tuples
supported for the given
surface is returned in
pSurfaceFormatCount must point to a variable set by the
user to the number of elements in the
pSurfaceFormats array, and on
return the variable is overwritten with the number of structures actually
If the value of
pSurfaceFormatCount is less than the number of format
tuples supported, at most
pSurfaceFormatCount structures will be
pSurfaceFormatCount is smaller than the number of format tuples
supported for the surface parameters described in
VK_INCOMPLETE will be returned instead of
VK_SUCCESS to indicate
that not all the available values were returned.
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.