Function Prototype
vkAcquireNextImage2KHR
Retrieve the index of the next available presentable image
To acquire an available presentable image to use, and retrieve the index of that image, call:
VkResult vkAcquireNextImage2KHR(
VkDevice device,
const VkAcquireNextImageInfoKHR* pAcquireInfo,
uint32_t* pImageIndex);
deviceis the device associated withswapchain.pAcquireInfois a pointer to a VkAcquireNextImageInfoKHR structure containing parameters of the acquire.pImageIndexis a pointer to auint32_tvalue specifying the index of the next image to use.
If the swapchain has been created with the
VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT flag, the image
whose index is returned in pImageIndex will be fully backed by memory
before this call returns to the application.
Valid Usage
VUID-vkAcquireNextImage2KHR-surface-07784
If forward progress cannot be
guaranteed for the surface used to create swapchain, the
timeout member of pAcquireInfo must not be UINT64_MAX
Valid Usage (Implicit)
VUID-vkAcquireNextImage2KHR-device-parameter
device must be a valid VkDevice handle
VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter
pAcquireInfo must be a valid pointer to a valid VkAcquireNextImageInfoKHR structure
VUID-vkAcquireNextImage2KHR-pImageIndex-parameter
pImageIndex must be a valid pointer to a uint32_t value