Class KHRPresentWait
VK_KHR_swapchain extension to wait for present operations to complete. An application can use this to monitor and control the pacing of the application by managing the number of outstanding images yet to be presented.
- Name String
VK_KHR_present_wait- Extension Type
- Device extension
- Registered Extension Number
- 249
- Revision
- 1
- Extension and Version Dependencies
VK_KHR_swapchainandVK_KHR_present_id- Contact
- Keith Packard keithp
Other Extension Metadata
- Last Modified Date
- 2019-05-15
- IP Status
- No known IP claims.
- Contributors
- Keith Packard, Valve
- Ian Elliott, Google
- Tobias Hector, AMD
- Daniel Stone, Collabora
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intvkWaitForPresentKHR(org.lwjgl.vulkan.VkDevice device, long swapchain, long presentId, long timeout) Wait for presentation.
-
Field Details
-
VK_KHR_PRESENT_WAIT_SPEC_VERSION
public static final int VK_KHR_PRESENT_WAIT_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_KHR_PRESENT_WAIT_EXTENSION_NAME
The extension name.- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHRExtendsVkStructureType.- See Also:
-
-
Method Details
-
vkWaitForPresentKHR
public static int vkWaitForPresentKHR(org.lwjgl.vulkan.VkDevice device, long swapchain, long presentId, long timeout) Wait for presentation.C Specification
When the
presentWaitfeature is enabled, an application can wait for an image to be presented to the user by first specifying a presentId for the target presentation by adding aVkPresentIdKHRstructure to thepNextchain of theVkPresentInfoKHRstructure and then waiting for that presentation to complete by calling:VkResult vkWaitForPresentKHR( VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout);Description
vkWaitForPresentKHRwaits for the presentId associated withswapchainto be increased in value so that it is at least equal topresentId.For
PRESENT_MODE_MAILBOX_KHR(or other present mode where images may be replaced in the presentation queue) any wait of this type associated with such an image must be signaled no later than a wait associated with the replacing image would be signaled.When the presentation has completed, the presentId associated with the related
pSwapchainsentry will be increased in value so that it is at least equal to the value provided in theVkPresentIdKHRstructure.There is no requirement for any precise timing relationship between the presentation of the image to the user and the update of the presentId value, but implementations should make this as close as possible to the presentation of the first pixel in the next image being presented to the user.
The call to
vkWaitForPresentKHRwill block until either the presentId associated withswapchainis greater than or equal topresentId, ortimeoutnanoseconds passes. When the swapchain becomes OUT_OF_DATE, the call will either returnSUCCESS(if the image was delivered to the presentation engine and may have been presented to the user) or will return early with statusERROR_OUT_OF_DATE_KHR(if the image was not presented to the user).As an exception to the normal rules for objects which are externally synchronized, the
swapchainpassed tovkWaitForPresentKHRmay be simultaneously used by other threads in calls to functions other thanDestroySwapchainKHR. Access to the swapchain data associated with this extension must be atomic within the implementation.Valid Usage
swapchainmust not be in the retired state- The
presentWaitfeature must be enabled
Valid Usage (Implicit)
devicemust be a validVkDevicehandleswapchainmust be a validVkSwapchainKHRhandleswapchainmust have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
swapchainmust be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
device- the device associated withswapchain.swapchain- the non-retired swapchain on which an image was queued for presentation.presentId- the presentation presentId to wait for.timeout- the timeout period in units of nanoseconds.timeoutis adjusted to the closest value allowed by the implementation-dependent timeout accuracy, which may be substantially longer than one nanosecond, and may be longer than the requested period.
-