VkPresentInfoKHR
The VkPresentInfoKHR structure is defined as:
typedef struct VkPresentInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t waitSemaphoreCount;
const VkSemaphore* pWaitSemaphores;
uint32_t swapchainCount;
const VkSwapchainKHR* pSwapchains;
const uint32_t* pImageIndices;
VkResult* pResults;
} VkPresentInfoKHR;
pub struct PresentInfoKHR {
s_type: vk::StructureType,
p_next: *const c_void,
wait_semaphore_count: u32, // Number of semaphores to wait for before presenting
p_wait_semaphores: *const vk::Semaphore, // Semaphores to wait for before presenting
swapchain_count: u32, // Number of swapchains to present in this call
p_swapchains: *const vk::SwapchainKHR, // Swapchains to present an image from
p_image_indices: *const u32, // Indices of which presentable images to present
p_results: *mut vk::Result, // Optional (i.e. if non-NULL) VkResult for each swapchain
}
sTypeis a VkStructureType value identifying this structure.pNextisNULLor a pointer to a structure extending this structure.waitSemaphoreCountis the number of semaphores to wait for before issuing the present request. The number may be zero.pWaitSemaphoresisNULLor a pointer to an array of VkSemaphore objects withwaitSemaphoreCountentries, and specifies the semaphores to wait for before issuing the present request.swapchainCountis the number of swapchains being presented to by this command.pSwapchainsis a pointer to an array of VkSwapchainKHR objects withswapchainCountentries.pImageIndicesis a pointer to an array of indices into the array of each swapchain’s presentable images, withswapchainCountentries. Each entry in this array identifies the image to present on the corresponding entry in thepSwapchainsarray.pResultsis a pointer to an array of VkResult typed elements withswapchainCountentries. Applications that do not need per-swapchain results can useNULLforpResults. If non-NULL, each entry inpResultswill be set to the VkResult for presenting the swapchain corresponding to the same index inpSwapchains.
Before an application can present an image, the image’s layout must be
transitioned to the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
layout, or for a shared presentable image the
VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout.
dstAccessMask member of the
VkImageMemoryBarriershould be 0, and the dstStageMask
parameter should be VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT.The second synchronization scope of
each semaphore wait operation defined
by this structure includes presentation of each image indicated by
pSwapchains and pImageIndices.
Valid Usage
VUID-VkPresentInfoKHR-pSwapchain-09231
Elements of pSwapchain must be unique
VUID-VkPresentInfoKHR-pImageIndices-01430
Each element of pImageIndices must be the index of a presentable
image acquired from the swapchain specified by the corresponding element
of the pSwapchains array, and the presented image subresource
must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
layout at the time the operation is executed on a VkDevice
VUID-VkPresentInfoKHR-pNext-06235
If a VkPresentIdKHR structure is included in the pNext
chain, and the presentId feature is not
enabled, each presentIds entry in that structure must be NULL
VUID-VkPresentInfoKHR-swapchainMaintenance1-10158
If the swapchainMaintenance1
feature is not enabled, then the pNext chain must not include a
VkSwapchainPresentFenceInfoKHR structure
VUID-VkPresentInfoKHR-pSwapchains-09199
If any element of the pSwapchains array has been created with
VkSwapchainPresentModesCreateInfoKHR, all of the elements of this
array must be created with VkSwapchainPresentModesCreateInfoKHR
VUID-VkPresentInfoKHR-pNext-09759
If the pNext chain of this structure includes a
VkFrameBoundaryTensorsARM structure then it must also include a
VkFrameBoundaryEXT structure
VUID-VkPresentInfoKHR-pNext-10821
If a VkPresentId2KHR structure is included in the pNext
chain, and the presentId2 feature is not
enabled, each presentIds entry in that structure must be zero
VUID-VkPresentInfoKHR-presentId2Supported-10822
If a VkPresentId2KHR structure is included and contains non-zero
presentIds, presentId2Supported must be VK_TRUE in the
VkSurfaceCapabilitiesPresentId2KHR structure returned by
vkGetPhysicalDeviceSurfaceCapabilities2KHR for the surface
Valid Usage (Implicit)
VUID-VkPresentInfoKHR-sType-sType
sType must be VK_STRUCTURE_TYPE_PRESENT_INFO_KHR
VUID-VkPresentInfoKHR-pNext-pNext
Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupPresentInfoKHR, VkDisplayPresentInfoKHR, VkFrameBoundaryEXT, VkFrameBoundaryTensorsARM, VkPresentFrameTokenGGP, VkPresentId2KHR, VkPresentIdKHR, VkPresentRegionsKHR, VkPresentTimesInfoGOOGLE, VkPresentTimingsInfoEXT, VkSetPresentConfigNV, VkSwapchainPresentFenceInfoKHR, or VkSwapchainPresentModeInfoKHR
VUID-VkPresentInfoKHR-sType-unique
The sType value of each structure in the pNext chain must be unique
VUID-VkPresentInfoKHR-pWaitSemaphores-parameter
If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles
VUID-VkPresentInfoKHR-pSwapchains-parameter
pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles
VUID-VkPresentInfoKHR-pImageIndices-parameter
pImageIndices must be a valid pointer to an array of swapchainCount uint32_t values
VUID-VkPresentInfoKHR-pResults-parameter
If pResults is not NULL, pResults must be a valid pointer to an array of swapchainCount VkResult values
VUID-VkPresentInfoKHR-swapchainCount-arraylength
swapchainCount must be greater than 0
VUID-VkPresentInfoKHR-commonparent
Both of the elements of pSwapchains, and the elements of pWaitSemaphores that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice
Host Synchronization
- Host access to each member of
pWaitSemaphoresmust be externally synchronized - Host access to each member of
pSwapchainsmust be externally synchronized