Class GOOGLEDisplayTiming
- java.lang.Object
-
- org.lwjgl.vulkan.GOOGLEDisplayTiming
-
public class GOOGLEDisplayTiming extends java.lang.ObjectThis device extension allows an application that uses theVK_KHR_swapchainextension to obtain information about the presentation engine's display, to obtain timing information about each present, and to schedule a present to happen no earlier than a desired time. An application can use this to minimize various visual anomalies (e.g. stuttering).Traditional game and real-time animation applications need to correctly position their geometry for when the presentable image will be presented to the user. To accomplish this, applications need various timing information about the presentation engine's display. They need to know when presentable images were actually presented, and when they could have been presented. Applications also need to tell the presentation engine to display an image no sooner than a given time. This allows the application to avoid stuttering, so the animation looks smooth to the user.
This extension treats variable-refresh-rate (VRR) displays as if they are fixed-refresh-rate (FRR) displays.
Examples
Note
The example code for the this extension (like the
VK_KHR_surfaceandVK_GOOGLE_display_timingextensions) is contained in the cube demo that is shipped with the official Khronos SDK, and is being kept up-to-date in that location (see: https://github.com/KhronosGroup/Vulkan-Tools/blob/master/cube/cube.c ).- Name String
VK_GOOGLE_display_timing- Extension Type
- Device extension
- Registered Extension Number
- 93
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_swapchain
- Contact
- Ian Elliott ianelliottus
- Last Modified Date
- 2017-02-14
- IP Status
- No known IP claims.
- Contributors
- Ian Elliott, Google
- Jesse Hall, Google
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAMEThe extension name.static intVK_GOOGLE_DISPLAY_TIMING_SPEC_VERSIONThe extension specification version.static intVK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLEExtendsVkStructureType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intnvkGetPastPresentationTimingGOOGLE(VkDevice device, long swapchain, long pPresentationTimingCount, long pPresentationTimings)Unsafe version of:GetPastPresentationTimingGOOGLEstatic intnvkGetRefreshCycleDurationGOOGLE(VkDevice device, long swapchain, long pDisplayTimingProperties)Unsafe version of:GetRefreshCycleDurationGOOGLEstatic intvkGetPastPresentationTimingGOOGLE(VkDevice device, long swapchain, int[] pPresentationTimingCount, VkPastPresentationTimingGOOGLE.Buffer pPresentationTimings)Array version of:GetPastPresentationTimingGOOGLEstatic intvkGetPastPresentationTimingGOOGLE(VkDevice device, long swapchain, java.nio.IntBuffer pPresentationTimingCount, VkPastPresentationTimingGOOGLE.Buffer pPresentationTimings)Obtain timing of a previously-presented image.static intvkGetRefreshCycleDurationGOOGLE(VkDevice device, long swapchain, VkRefreshCycleDurationGOOGLE pDisplayTimingProperties)Obtain the RC duration of the PE's display.
-
-
-
Field Detail
-
VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION
public static final int VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION
The extension specification version.- See Also:
- Constant Field Values
-
VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME
public static final java.lang.String VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME
The extension name.- See Also:
- Constant Field Values
-
VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE
public static final int VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE
ExtendsVkStructureType.- See Also:
- Constant Field Values
-
-
Method Detail
-
nvkGetRefreshCycleDurationGOOGLE
public static int nvkGetRefreshCycleDurationGOOGLE(VkDevice device, long swapchain, long pDisplayTimingProperties)
Unsafe version of:GetRefreshCycleDurationGOOGLE
-
vkGetRefreshCycleDurationGOOGLE
public static int vkGetRefreshCycleDurationGOOGLE(VkDevice device, long swapchain, VkRefreshCycleDurationGOOGLE pDisplayTimingProperties)
Obtain the RC duration of the PE's display.C Specification
To query the duration of a refresh cycle (RC) for the presentation engine's display, call:
VkResult vkGetRefreshCycleDurationGOOGLE( VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties);Valid Usage (Implicit)
devicemust be a validVkDevicehandleswapchainmust be a validVkSwapchainKHRhandlepDisplayTimingPropertiesmust be a valid pointer to aVkRefreshCycleDurationGOOGLEstructure- Both of
device, andswapchainmust have been created, allocated, or retrieved from the sameVkInstance
Host Synchronization
- Host access to
swapchainmust be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the device associated withswapchain.swapchain- the swapchain to obtain the refresh duration for.pDisplayTimingProperties- a pointer to an instance of theVkRefreshCycleDurationGOOGLEstructure.
-
nvkGetPastPresentationTimingGOOGLE
public static int nvkGetPastPresentationTimingGOOGLE(VkDevice device, long swapchain, long pPresentationTimingCount, long pPresentationTimings)
Unsafe version of:GetPastPresentationTimingGOOGLE- Parameters:
pPresentationTimingCount- a pointer to an integer related to the number ofVkPastPresentationTimingGOOGLEstructures to query, as described below.
-
vkGetPastPresentationTimingGOOGLE
public static int vkGetPastPresentationTimingGOOGLE(VkDevice device, long swapchain, java.nio.IntBuffer pPresentationTimingCount, @Nullable VkPastPresentationTimingGOOGLE.Buffer pPresentationTimings)
Obtain timing of a previously-presented image.C Specification
The implementation will maintain a limited amount of history of timing information about previous presents. Because of the asynchronous nature of the presentation engine, the timing information for a given
QueuePresentKHRcommand will become available some time later. These time values can be asynchronously queried, and will be returned if available. All time values are in nanoseconds, relative to a monotonically-increasing clock (e.g.CLOCK_MONOTONIC(see clock_gettime(2)) on Android and Linux).To asynchronously query the presentation engine, for newly-available timing information about one or more previous presents to a given swapchain, call:
VkResult vkGetPastPresentationTimingGOOGLE( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings);Description
If
pPresentationTimingsisNULL, then the number of newly-available timing records for the givenswapchainis returned inpPresentationTimingCount. Otherwise,pPresentationTimingCountmust point to a variable set by the user to the number of elements in thepPresentationTimingsarray, and on return the variable is overwritten with the number of structures actually written topPresentationTimings. If the value ofpPresentationTimingCountis less than the number of newly-available timing records, at mostpPresentationTimingCountstructures will be written. IfpPresentationTimingCountis smaller than the number of newly-available timing records for the givenswapchain,INCOMPLETEwill be returned instead ofSUCCESSto indicate that not all the available values were returned.Valid Usage (Implicit)
devicemust be a validVkDevicehandleswapchainmust be a validVkSwapchainKHRhandlepPresentationTimingCountmust be a valid pointer to auint32_tvalue- If the value referenced by
pPresentationTimingCountis not 0, andpPresentationTimingsis notNULL,pPresentationTimingsmust be a valid pointer to an array ofpPresentationTimingCountVkPastPresentationTimingGOOGLEstructures - Both of
device, andswapchainmust have been created, allocated, or retrieved from the sameVkInstance
Host Synchronization
- Host access to
swapchainmust be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the device associated withswapchain.swapchain- the swapchain to obtain presentation timing information duration for.pPresentationTimingCount- a pointer to an integer related to the number ofVkPastPresentationTimingGOOGLEstructures to query, as described below.pPresentationTimings- eitherNULLor a pointer to an array ofVkPastPresentationTimingGOOGLEstructures.
-
vkGetPastPresentationTimingGOOGLE
public static int vkGetPastPresentationTimingGOOGLE(VkDevice device, long swapchain, int[] pPresentationTimingCount, @Nullable VkPastPresentationTimingGOOGLE.Buffer pPresentationTimings)
Array version of:GetPastPresentationTimingGOOGLE
-
-