C Specification
To query the supported swapchain format-color space pairs for a surface, call:
VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats);
Parameters
-
physicalDeviceis the physical device that will be associated with the swapchain to be created, as described for vkCreateSwapchainKHR. -
surfaceis the surface that will be associated with the swapchain. -
pSurfaceFormatCountis a pointer to an integer related to the number of format pairs available or queried, as described below. -
pSurfaceFormatsis eitherNULLor a pointer to an array ofVkSurfaceFormatKHRstructures.
Description
If pSurfaceFormats is NULL, then the number of format pairs
supported for the given surface is returned in
pSurfaceFormatCount.
Otherwise, 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
written to pSurfaceFormats.
If the value of pSurfaceFormatCount is less than the number of format
pairs supported, at most pSurfaceFormatCount structures will be
written.
If pSurfaceFormatCount is smaller than the number of format pairs
supported for the given surface, VK_INCOMPLETE will be returned
instead of VK_SUCCESS to indicate that not all the available values
were returned.
The number of format pairs supported must be greater than or equal to 1.
See Also
Document Notes
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
Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.