HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_NV_low_latency2

Name

VK_NV_low_latency2 - device extension

VK_NV_low_latency2

Name String

VK_NV_low_latency2

Extension Type

Device extension

Registered Extension Number

506

Revision

2

Ratification Status

Not ratified

Extension and Version Dependencies

Vulkan Version 1.2      or

VK_KHR_timeline_semaphore and

VK_KHR_present_id      or

VK_KHR_present_id2

Contact

Other Extension Metadata

Last Modified Date

2023-09-25

Contributors
  • Charles Hansen, NVIDIA

  • Liam Middlebrook, NVIDIA

  • Lionel Duc, NVIDIA

  • James Jones, NVIDIA

  • Eric Sullivan, NVIDIA

New Commands

New Structures

New Enums

New Enum Constants

Description

This extension gives applications timing suggestions on when to start the recording of new frames to reduce the latency between input sampling and frame presentation. Applications can accomplish this through the extension by calling setLatencySleepModeNV to allow the driver to pace a given swapchain, then calling latencySleepNV before input sampling to delay the start of the CPU side work. Additional methods and structures are provided to give insight into the latency pipeline of an application through the latency markers. VK_NV_low_latency provides legacy support for applications that make use of the NVIDIA Reflex SDK whereas new implementations should use the VK_NV_low_latency2 extension.

Issues

1) How does Low Latency 2 work with applications that utilize device groups?

Low Latency 2 does not support device groups.

Version History

  • Revision 1, 2023-09-25 (Charles Hansen)

    • Internal revisions

See Also

No cross-references are available

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.

  • 15 types
  • 5 values
  • Packagevulkan-3.27
  • Exports43
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_NV_low_latency2.hs
valuesetLatencySleepModeNV
  1. :: MonadIO io
  2. => Device

    device is the device associated with swapchain.

    device must be a valid Device handle

  3. -> SwapchainKHR

    swapchain is the swapchain to enable or disable low latency mode on.

    swapchain must be a valid SwapchainKHR handle

    swapchain must have been created, allocated, or retrieved from device

  4. -> LatencySleepModeInfoNV

    pSleepModeInfo is NULL or a pointer to a LatencySleepModeInfoNV structure specifying the parameters of the latency sleep mode.

    pSleepModeInfo must be a valid pointer to a valid LatencySleepModeInfoNV structure

  5. -> io ()
#

vkSetLatencySleepModeNV - Enable or Disable low latency mode on a swapchain

Description

If pSleepModeInfo is NULL, setLatencySleepModeNV will disable low latency mode, low latency boost, and set the minimum present interval previously specified by LatencySleepModeInfoNV to zero on swapchain. As an exception to the normal rules for objects which are externally synchronized, the swapchain passed to setLatencySleepModeNV may be simultaneously used by other threads in calls to functions other than destroySwapchainKHR. Access to the swapchain data associated with this extension must be atomic within the implementation.

Return Codes

Success
Failure

See Also

VK_NV_low_latency2, Device, LatencySleepModeInfoNV, SwapchainKHR

valuelatencySleepNV
  1. :: MonadIO io
  2. => Device

    device is the device associated with swapchain.

    device must be a valid Device handle

  3. -> SwapchainKHR

    swapchain is the swapchain to delay associated CPU work based on LatencySubmissionPresentIdNV submissions.

    swapchain must be a valid SwapchainKHR handle

    swapchain must have been created, allocated, or retrieved from device

  4. -> LatencySleepInfoNV

    pSleepInfo is a pointer to a LatencySleepInfoNV structure specifying the parameters of the latency sleep.

    pSleepInfo must be a valid pointer to a valid LatencySleepInfoNV structure

  5. -> io ()
#

vkLatencySleepNV - Trigger low latency mode Sleep

Description

latencySleepNV returns immediately. Applications should use waitSemaphores with pSleepInfo->signalSemaphore to delay host CPU work. CPU work refers to application work done before presenting which includes but is not limited to: input sampling, simulation, command buffer recording, command buffer submission, and present submission. Applications should call this function before input sampling, and exactly once between presents.

Return Codes

Success
Failure

See Also

VK_NV_low_latency2, Device, LatencySleepInfoNV, SwapchainKHR

valuesetLatencyMarkerNV
  1. :: MonadIO io
  2. => Device

    device is the device associated with swapchain.

    device must be a valid Device handle

  3. -> SwapchainKHR

    swapchain is the swapchain to capture timestamps on.

    swapchain must be a valid SwapchainKHR handle

    swapchain must have been created, allocated, or retrieved from device

  4. -> SetLatencyMarkerInfoNV

    pLatencyMarkerInfo must be a valid pointer to a valid SetLatencyMarkerInfoNV structure

  5. -> io ()
#

vkSetLatencyMarkerNV - Pass in marker for timing info

Description

At the beginning and end of simulation and render threads and beginning and end of queuePresentKHR calls, setLatencyMarkerNV can be called to provide timestamps for the application’s reference. These timestamps are returned with a call to getLatencyTimingsNV alongside driver provided timestamps at various points of interest with regards to latency within the application. As an exception to the normal rules for objects which are externally synchronized, the swapchain passed to setLatencyMarkerNV may be simultaneously used by other threads in calls to functions other than destroySwapchainKHR. Access to the swapchain data associated with this extension must be atomic within the implementation.

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, Device, SetLatencyMarkerInfoNV, SwapchainKHR

valuegetLatencyTimingsNV
  1. :: MonadIO io
  2. => Device

    device is the device associated with swapchain.

    device must be a valid Device handle

  3. -> SwapchainKHR

    swapchain is the swapchain to return data from.

    swapchain must be a valid SwapchainKHR handle

    swapchain must have been created, allocated, or retrieved from device

  4. -> io GetLatencyMarkerInfoNV
#

vkGetLatencyTimingsNV - Get latency marker results

Description

The timings returned by getLatencyTimingsNV contain the timestamps requested from setLatencyMarkerNV and additional implementation-specific markers defined in LatencyTimingsFrameReportNV.

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, Device, GetLatencyMarkerInfoNV, SwapchainKHR

valuequeueNotifyOutOfBandNV
  1. :: MonadIO io
  2. => Queue

    queue is the VkQueue to be marked as out of band.

    queue must be a valid Queue handle

  3. -> OutOfBandQueueTypeInfoNV

    pQueueTypeInfo is a pointer to a OutOfBandQueueTypeInfoNV structure specifying the queue type.

    pQueueTypeInfo must be a valid pointer to a valid OutOfBandQueueTypeInfoNV structure

  4. -> io ()
#

VkLatencySleepModeInfoNV - Structure to set low latency mode

Description

If lowLatencyMode is FALSE, lowLatencyBoost will still hint to the GPU to increase its power state and latencySleepNV will still enforce minimumIntervalUs between queuePresentKHR calls.

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, Bool32, StructureType, setLatencySleepModeNV

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
datadata LatencySleepInfoNV
#

VkLatencySleepInfoNV - Structure specifying the parameters of vkLatencySleepNV

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, Semaphore, StructureType, latencySleepNV

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkSetLatencyMarkerInfoNV - Structure specifying the parameters of vkSetLatencyMarkerNV

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, LatencyMarkerNV, StructureType, setLatencyMarkerNV

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkGetLatencyMarkerInfoNV - Structure specifying the parameters of vkGetLatencyTimingsNV

Description

If pTimings is NULL then the maximum number of queryable frame data is returned in timingCount. Otherwise, timingCount must be set by the application to the number of elements in the pTimings array, and on return is overwritten with the number of values actually written to pTimings. The elements of pTimings are arranged in the order they were requested in, with the oldest data in the first entry.

Valid Usage (Implicit)

  • If timingCount is not 0, and pTimings is not NULL, pTimings must be a valid pointer to an array of timingCount LatencyTimingsFrameReportNV structures

See Also

VK_NV_low_latency2, LatencyTimingsFrameReportNV, StructureType, getLatencyTimingsNV

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkLatencyTimingsFrameReportNV - Structure containing latency data

Members

The members of the LatencyTimingsFrameReportNV structure describe the following:

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, GetLatencyMarkerInfoNV, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkOutOfBandQueueTypeInfoNV - Structure used to describe the queue that is being marked as Out of Band

Valid Usage (Implicit)

See Also

VK_NV_low_latency2, OutOfBandQueueTypeNV, StructureType, queueNotifyOutOfBandNV

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkLatencySubmissionPresentIdNV - Structure used to associate a queueSubmit with a presentId

Description

For any submission to be tracked with low latency mode pacing, it needs to be associated with other submissions in a given present. To associate a submission with presentID for low latency mode, the pNext chain of queueSubmit must include a LatencySubmissionPresentIdNV structure.

Structure Chaining

Extends the structures

See Also

VK_NV_low_latency2, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkSwapchainLatencyCreateInfoNV - Specify that a swapchain will use low latency mode

Structure Chaining

Extends the structure

See Also

VK_NV_low_latency2, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkLatencySurfaceCapabilitiesNV - Structure describing surface optimized presentation modes for use with low latency mode

Description

If pPresentModes is NULL, then the number of present modes that are optimized for use with low latency mode returned in presentModeCount. Otherwise, presentModeCount must be set by the application to the number of elements in the pPresentModes array, and on return is overwritten with the number of values actually written to pPresentModes. If the value of presentModeCount is less than the number of optimized present modes, at most presentModeCount values will be written to pPresentModes.

Valid Usage (Implicit)

  • If presentModeCount is not 0, and pPresentModes is not NULL, pPresentModes must be a valid pointer to an array of presentModeCount PresentModeKHR values

Structure Chaining

Extends the structure

See Also

VK_NV_low_latency2, PresentModeKHR, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
newtypenewtype LatencyMarkerNV
#

VkLatencyMarkerNV - Structure used to mark different points in latency

Description

The members of the LatencyMarkerNV are used as arguments for setLatencyMarkerNV in the use cases described below:

See Also

VK_NV_low_latency2, SetLatencyMarkerInfoNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype OutOfBandQueueTypeNV
#

VkOutOfBandQueueTypeNV - Type of out of band queue

Description

The members of the OutOfBandQueueTypeNV are used to describe the queue type in OutOfBandQueueTypeInfoNV as described below:

See Also

VK_NV_low_latency2, OutOfBandQueueTypeInfoNV

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype SwapchainKHR
#

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.

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 releaseSwapchainImagesKHR, 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.

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_DEFINE_NON_DISPATCHABLE_HANDLE, VK_KHR_swapchain, AcquireNextImageInfoKHR, BindImageMemorySwapchainInfoKHR, ImageSwapchainCreateInfoKHR, PastPresentationTimingInfoEXT, PresentInfoKHR, ReleaseSwapchainImagesInfoKHR, SwapchainCalibratedTimestampInfoEXT, SwapchainCreateInfoKHR, acquireFullScreenExclusiveModeEXT, acquireNextImageKHR, createSharedSwapchainsKHR, createSwapchainKHR, destroySwapchainKHR, getLatencyTimingsNV, getPastPresentationTimingGOOGLE, getRefreshCycleDurationGOOGLE, getSwapchainCounterEXT, getSwapchainImagesKHR, getSwapchainStatusKHR, getSwapchainTimeDomainPropertiesEXT, getSwapchainTimingPropertiesEXT, latencySleepNV, queuePresentKHR, releaseFullScreenExclusiveModeEXT, setHdrMetadataEXT, setLatencyMarkerNV, setLatencySleepModeNV, setLocalDimmingAMD, setSwapchainPresentTimingQueueSizeEXT, waitForPresent2KHR, waitForPresentKHR

Constructors

Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
newtypenewtype PresentModeKHR
#

VkPresentModeKHR - Presentation mode supported for a surface

Description

  • PRESENT_MODE_IMMEDIATE_KHR specifies that the presentation engine does not wait for a vertical blanking period to update the current image, meaning this mode may result in visible tearing. No internal queuing of presentation requests is needed, as the requests are applied immediately.

  • PRESENT_MODE_MAILBOX_KHR specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal single-entry queue is used to hold pending presentation requests. If the queue is full when a new presentation request is received, the new request replaces the existing entry, and any images associated with the prior entry become available for reuse by the application. One request is removed from the queue and processed during each vertical blanking period in which the queue is non-empty.

  • PRESENT_MODE_FIFO_KHR specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during each vertical blanking period in which the queue is non-empty. This is the only value of presentMode that is required to be supported.

  • PRESENT_MODE_FIFO_RELAXED_KHR specifies that the presentation engine generally waits for the next vertical blanking period to update the current image. If a vertical blanking period has already passed since the last update of the current image then the presentation engine does not wait for another vertical blanking period for the update, meaning this mode may result in visible tearing in this case. This mode is useful for reducing visual stutter with an application that will mostly present a new image before the next vertical blanking period, but may occasionally be late, and present a new image just after the next vertical blanking period. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during or after each vertical blanking period in which the queue is non-empty.

  • PRESENT_MODE_FIFO_LATEST_READY_KHR specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue. At each vertical blanking period, the presentation engine dequeues all successive requests that are ready to be presented from the beginning of the queue. If using the VK_GOOGLE_display_timing extension or the presentAtAbsoluteTime feature to provide a target present time, the presentation engine checks the specified time for each image. If the target present time is less-than or equal-to the current time, the presentation engine dequeues the image and checks the next one. The image of the last dequeued request is presented. The other dequeued requests are dropped.

  • PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR specifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine is only required to update the current image after a new presentation request is received. Therefore the application must make a presentation request whenever an update is required. However, the presentation engine may update the current image at any point, meaning this mode may result in visible tearing.

  • PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR specifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine periodically updates the current image on its regular refresh cycle. The application is only required to make one initial presentation request, after which the presentation engine must update the current image without any need for further presentation requests. The application can indicate the image contents have been updated by making a presentation request, but this does not guarantee the timing of when it will be updated. This mode may result in visible tearing if rendering to the image is not timed correctly.

The supported ImageUsageFlagBits of the presentable images of a swapchain created for a surface may differ depending on the presentation mode, and can be determined as per the table below:

Presentable Image Usage Queries

For reference, the mode indicated by PRESENT_MODE_FIFO_KHR is equivalent to the behavior of {wgl|glX|egl}SwapBuffers with a swap interval of 1, while the mode indicated by PRESENT_MODE_FIFO_RELAXED_KHR is equivalent to the behavior of {wgl|glX}SwapBuffers with a swap interval of -1 (from the {WGL|GLX}_EXT_swap_control_tear extensions).

See Also

VK_KHR_surface, LatencySurfaceCapabilitiesNV, SurfacePresentModeCompatibilityKHR, SurfacePresentModeKHR, SwapchainCreateInfoKHR, SwapchainPresentModeInfoKHR, SwapchainPresentModesCreateInfoKHR, getPhysicalDeviceSurfacePresentModes2EXT, getPhysicalDeviceSurfacePresentModesKHR

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero