VKGETSWAPCHAINIMAGES(3)

NAME
vkGetSwapchainImagesKHR - Obtain the array of presentable images associated with a swapchain

C SPECIFICATION

To obtain the array of presentable images associated with a swapchain, call:

    VkResult vkGetSwapchainImagesKHR(
        VkDevice                                    device,
        VkSwapchainKHR                              swapchain,
        uint32_t*                                   pSwapchainImageCount,
        VkImage*                                    pSwapchainImages);

PARAMETERS

    • device is the device associated with swapchain.

    • swapchain is the swapchain to query.

    • pSwapchainImageCount is a pointer to an integer related to the number of swapchain images available or queried, as described below.

    • pSwapchainImages is either NULL or a pointer to an array of VkImage handles.

DESCRIPTION

If pSwapchainImages is NULL, then the number of presentable images for swapchain is returned in pSwapchainImageCount. Otherwise, pSwapchainImageCount must point to a variable set by the user to the number of elements in the pSwapchainImages array, and on return the variable is overwritten with the number of structures actually written to pSwapchainImages. If the value of pSwapchainImageCount is less than the number of presentable images for swapchain, at most pSwapchainImageCount structures will be written. If pSwapchainImageCount is smaller than the number of presentable images for swapchain, VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that not all the available values were returned.

VALID USAGE

    • device must be a valid VkDevice handle

    • swapchain must be a valid VkSwapchainKHR handle

    • pSwapchainImageCount must be a pointer to a uint32_t value

    • If the value referenced by pSwapchainImageCount is not 0, and pSwapchainImages is not NULL, pSwapchainImages must be a pointer to an array of pSwapchainImageCount VkImage handles

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

SEE ALSO

VkDevice, VkImage, VkSwapchainKHR

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

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

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.