VKGETPHYSICALDEVICES(3)

NAME
vkGetPhysicalDeviceSurfaceFormatsKHR - Query color formats supported by surface

C SPECIFICATION

To query the supported swapchain format-colorspace pairs for a surface, call:

    VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
        VkPhysicalDevice                            physicalDevice,
        VkSurfaceKHR                                surface,
        uint32_t*                                   pSurfaceFormatCount,
        VkSurfaceFormatKHR*                         pSurfaceFormats);

PARAMETERS

    • physicalDevice is the physical device that will be associated with the swapchain to be created, as described for vkCreateSwapchainKHR.

    • surface is the surface that will be associated with the swapchain.

    • pSurfaceFormatCount is a pointer to an integer related to the number of format pairs available or queried, as described below.

    • pSurfaceFormats is either NULL or a pointer to an array of VkSurfaceFormatKHR structures.

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.

VALID USAGE

    • physicalDevice must be a valid VkPhysicalDevice handle

    • surface must be a valid VkSurfaceKHR handle

    • pSurfaceFormatCount must be a pointer to a uint32_t value

    • If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a pointer to an array of pSurfaceFormatCount VkSurfaceFormatKHR structures

RETURN CODES

On success, this command returns

        • VK_SUCCESS

        • VK_INCOMPLETE

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

        • VK_ERROR_SURFACE_LOST_KHR

SEE ALSO

VkPhysicalDevice, VkSurfaceFormatKHR, VkSurfaceKHR

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkGetPhysicalDeviceSurfaceFormatsKHR

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.