C Specification
To obtain the array of presentable images associated with a swapchain, call:
// Provided by VK_KHR_swapchain
VkResult vkGetSwapchainImagesKHR(
VkDevice device,
VkSwapchainKHR swapchain,
uint32_t* pSwapchainImageCount,
VkImage* pSwapchainImages);
Parameters
-
device
is the device associated withswapchain
. -
swapchain
is the swapchain to query. -
pSwapchainImageCount
is a pointer to an integer related to the number of presentable images available or queried, as described below. -
pSwapchainImages
is eitherNULL
or a pointer to an array ofVkImage
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, and VK_INCOMPLETE
will be returned instead
of VK_SUCCESS
, to indicate that not all the available presentable
images were returned.
If
VkPhysicalDeviceVulkanSC10Properties::deviceNoDynamicHostAllocations
is VK_TRUE
, vkGetSwapchainImagesKHR
must not return
VK_ERROR_OUT_OF_HOST_MEMORY
.
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.