vulkan-3.26.1: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Extensions.VK_GOOGLE_display_timing

Description

Name

VK_GOOGLE_display_timing - device extension

VK_GOOGLE_display_timing

Name String
VK_GOOGLE_display_timing
Extension Type
Device extension
Registered Extension Number
93
Revision
1
Ratification Status
Not ratified
Extension and Version Dependencies
VK_KHR_swapchain
Contact

Other Extension Metadata

Last Modified Date
2017-02-14
IP Status
No known IP claims.
Contributors
  • Ian Elliott, Google
  • Jesse Hall, Google

Description

This device extension allows an application that uses the VK_KHR_swapchain extension 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.

New Commands

New Structures

New Enum Constants

Examples

Note

The example code for the this extension (like the VK_KHR_surface and VK_GOOGLE_display_timing extensions) 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 ).

Version History

  • Revision 1, 2017-02-14 (Ian Elliott)

    • Internal revisions

See Also

PastPresentationTimingGOOGLE, PresentTimeGOOGLE, PresentTimesInfoGOOGLE, RefreshCycleDurationGOOGLE, getPastPresentationTimingGOOGLE, getRefreshCycleDurationGOOGLE

Document Notes

For more information, see the Vulkan Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

getRefreshCycleDurationGOOGLE Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the device associated with swapchain.

-> SwapchainKHR

swapchain is the swapchain to obtain the refresh duration for.

-> io ("displayTimingProperties" ::: RefreshCycleDurationGOOGLE) 

vkGetRefreshCycleDurationGOOGLE - Obtain the RC duration of the PE’s display

Valid Usage (Implicit)

  • device must be a valid Device handle
  • swapchain must be a valid SwapchainKHR handle
  • pDisplayTimingProperties must be a valid pointer to a RefreshCycleDurationGOOGLE structure
  • swapchain must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to swapchain must be externally synchronized

Return Codes

Success
Failure

See Also

VK_GOOGLE_display_timing, Device, RefreshCycleDurationGOOGLE, SwapchainKHR

getPastPresentationTimingGOOGLE Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the device associated with swapchain.

-> SwapchainKHR

swapchain is the swapchain to obtain presentation timing information duration for.

-> io (Result, "presentationTimings" ::: Vector PastPresentationTimingGOOGLE) 

vkGetPastPresentationTimingGOOGLE - Obtain timing of a previously-presented image

Description

If pPresentationTimings is NULL, then the number of newly-available timing records for the given swapchain is returned in pPresentationTimingCount. Otherwise, pPresentationTimingCount must point to a variable set by the user to the number of elements in the pPresentationTimings array, and on return the variable is overwritten with the number of structures actually written to pPresentationTimings. If the value of pPresentationTimingCount is less than the number of newly-available timing records, at most pPresentationTimingCount structures will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available timing records were returned.

Valid Usage (Implicit)

  • device must be a valid Device handle
  • swapchain must be a valid SwapchainKHR handle
  • pPresentationTimingCount must be a valid pointer to a uint32_t value
  • If the value referenced by pPresentationTimingCount is not 0, and pPresentationTimings is not NULL, pPresentationTimings must be a valid pointer to an array of pPresentationTimingCount PastPresentationTimingGOOGLE structures
  • swapchain must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to swapchain must be externally synchronized

Return Codes

Success
Failure

See Also

VK_GOOGLE_display_timing, Device, PastPresentationTimingGOOGLE, SwapchainKHR

data RefreshCycleDurationGOOGLE Source #

VkRefreshCycleDurationGOOGLE - Structure containing the RC duration of a display

See Also

VK_GOOGLE_display_timing, getRefreshCycleDurationGOOGLE

Constructors

RefreshCycleDurationGOOGLE 

Fields

  • refreshDuration :: Word64

    refreshDuration is the number of nanoseconds from the start of one refresh cycle to the next.

Instances

Instances details
Storable RefreshCycleDurationGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Show RefreshCycleDurationGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Eq RefreshCycleDurationGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

FromCStruct RefreshCycleDurationGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

ToCStruct RefreshCycleDurationGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Zero RefreshCycleDurationGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

data PastPresentationTimingGOOGLE Source #

VkPastPresentationTimingGOOGLE - Structure containing timing information about a previously-presented image

Description

The results for a given swapchain and presentID are only returned once from getPastPresentationTimingGOOGLE.

The application can use the PastPresentationTimingGOOGLE values to occasionally adjust its timing. For example, if actualPresentTime is later than expected (e.g. one refreshDuration late), the application may increase its target IPD to a higher multiple of refreshDuration (e.g. decrease its frame rate from 60Hz to 30Hz). If actualPresentTime and earliestPresentTime are consistently different, and if presentMargin is consistently large enough, the application may decrease its target IPD to a smaller multiple of refreshDuration (e.g. increase its frame rate from 30Hz to 60Hz). If actualPresentTime and earliestPresentTime are same, and if presentMargin is consistently high, the application may delay the start of its input-render-present loop in order to decrease the latency between user input and the corresponding present (always leaving some margin in case a new image takes longer to render than the previous image). An application that desires its target IPD to always be the same as refreshDuration, can also adjust features until actualPresentTime is never late and presentMargin is satisfactory.

See Also

VK_GOOGLE_display_timing, getPastPresentationTimingGOOGLE

Constructors

PastPresentationTimingGOOGLE 

Fields

  • presentID :: Word32

    presentID is an application-provided value that was given to a previous queuePresentKHR command via PresentTimeGOOGLE::presentID (see below). It can be used to uniquely identify a previous present with the queuePresentKHR command.

  • desiredPresentTime :: Word64

    desiredPresentTime is an application-provided value that was given to a previous queuePresentKHR command via PresentTimeGOOGLE::desiredPresentTime. If non-zero, it was used by the application to indicate that an image not be presented any sooner than desiredPresentTime.

  • actualPresentTime :: Word64

    actualPresentTime is the time when the image of the swapchain was actually displayed.

  • earliestPresentTime :: Word64

    earliestPresentTime is the time when the image of the swapchain could have been displayed. This may differ from actualPresentTime if the application requested that the image be presented no sooner than PresentTimeGOOGLE::desiredPresentTime.

  • presentMargin :: Word64

    presentMargin is an indication of how early the queuePresentKHR command was processed compared to how soon it needed to be processed, and still be presented at earliestPresentTime.

Instances

Instances details
Storable PastPresentationTimingGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Show PastPresentationTimingGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Eq PastPresentationTimingGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

FromCStruct PastPresentationTimingGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

ToCStruct PastPresentationTimingGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Zero PastPresentationTimingGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

data PresentTimesInfoGOOGLE Source #

VkPresentTimesInfoGOOGLE - The earliest time each image should be presented

Valid Usage

Valid Usage (Implicit)

  • If pTimes is not NULL, pTimes must be a valid pointer to an array of swapchainCount PresentTimeGOOGLE structures
  • swapchainCount must be greater than 0

See Also

VK_GOOGLE_display_timing, PresentTimeGOOGLE, StructureType

Constructors

PresentTimesInfoGOOGLE 

Fields

data PresentTimeGOOGLE Source #

VkPresentTimeGOOGLE - The earliest time image should be presented

Description

but does not need a specific pname:desiredPresentTime.

See Also

VK_GOOGLE_display_timing, PresentTimesInfoGOOGLE

Constructors

PresentTimeGOOGLE 

Fields

  • presentID :: Word32

    presentID is an application-provided identification value, that can be used with the results of getPastPresentationTimingGOOGLE, in order to uniquely identify this present. In order to be useful to the application, it should be unique within some period of time that is meaningful to the application.

  • desiredPresentTime :: Word64

    desiredPresentTime specifies that the image given should not be displayed to the user any earlier than this time. desiredPresentTime is a time in nanoseconds, relative to a monotonically-increasing clock (e.g. CLOCK_MONOTONIC (see clock_gettime(2)) on Android and Linux). A value of zero specifies that the presentation engine may display the image at any time. This is useful when the application desires to provide presentID,

Instances

Instances details
Storable PresentTimeGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Show PresentTimeGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Eq PresentTimeGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

FromCStruct PresentTimeGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

ToCStruct PresentTimeGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

Zero PresentTimeGOOGLE Source # 
Instance details

Defined in Vulkan.Extensions.VK_GOOGLE_display_timing

type GOOGLE_DISPLAY_TIMING_EXTENSION_NAME = "VK_GOOGLE_display_timing" Source #

pattern GOOGLE_DISPLAY_TIMING_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #

newtype SwapchainKHR Source #

VkSwapchainKHR - Opaque handle to a swapchain object

Description

A swapchain is an abstraction for an array of presentable images that are associated with a surface. The presentable images are represented by Image objects created by the platform. One image (which can be an array image for multiview/stereoscopic-3D surfaces) is displayed at a time, but multiple images can be queued for presentation. An application renders to the image, and then queues the image for presentation to the surface.

A native window cannot be associated with more than one non-retired swapchain at a time. Further, swapchains cannot be created for native windows that have a non-Vulkan graphics API surface associated with them.

Note

The presentation engine is an abstraction for the platform’s compositor or display engine.

The presentation engine may be synchronous or asynchronous with respect to the application and/or logical device.

Some implementations may use the device’s graphics queue or dedicated presentation hardware to perform presentation.

The presentable images of a swapchain are owned by the presentation engine. An application can acquire use of a presentable image from the presentation engine. Use of a presentable image must occur only after the image is returned by acquireNextImageKHR, and before it is released by queuePresentKHR. This includes transitioning the image layout and rendering commands.

An application can acquire use of a presentable image with acquireNextImageKHR. After acquiring a presentable image and before modifying it, the application must use a synchronization primitive to ensure that the presentation engine has finished reading from the image. The application can then transition the image’s layout, queue rendering commands to it, etc. Finally, the application presents the image with queuePresentKHR, which releases the acquisition of the image. The application can also release the acquisition of the image through releaseSwapchainImagesEXT, if the image is not in use by the device, and skip the present operation.

The presentation engine controls the order in which presentable images are acquired for use by the application.

Note

This allows the platform to handle situations which require out-of-order return of images after presentation. At the same time, it allows the application to generate command buffers referencing all of the images in the swapchain at initialization time, rather than in its main loop.

See Also

VK_KHR_swapchain, AcquireNextImageInfoKHR, BindImageMemorySwapchainInfoKHR, ImageSwapchainCreateInfoKHR, PresentInfoKHR, ReleaseSwapchainImagesInfoEXT, SwapchainCreateInfoKHR, acquireFullScreenExclusiveModeEXT, acquireNextImageKHR, createSharedSwapchainsKHR, createSwapchainKHR, destroySwapchainKHR, getLatencyTimingsNV, getPastPresentationTimingGOOGLE, getRefreshCycleDurationGOOGLE, getSwapchainCounterEXT, getSwapchainImagesKHR, getSwapchainStatusKHR, latencySleepNV, queuePresentKHR, releaseFullScreenExclusiveModeEXT, setHdrMetadataEXT, setLatencyMarkerNV, setLatencySleepModeNV, setLocalDimmingAMD, waitForPresentKHR

Constructors

SwapchainKHR Word64 

Instances

Instances details
Storable SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles

Show SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles

Eq SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles

Ord SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles

HasObjectType SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles

IsHandle SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles

Zero SwapchainKHR Source # 
Instance details

Defined in Vulkan.Extensions.Handles