| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_EXT_present_timing
Description
Name
VK_EXT_present_timing - device extension
VK_EXT_present_timing
- Name String
VK_EXT_present_timing
- Extension Type
- Device extension
- Registered Extension Number
- 209
- Revision
- 3
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_swapchain and VK_KHR_present_id2 and VK_KHR_get_surface_capabilities2 and VK_KHR_calibrated_timestamps
- Contact
- Extension Proposal
- VK_EXT_present_timing
Other Extension Metadata
- Last Modified Date
- 2024-10-09
- IP Status
- No known IP claims.
- Contributors
- Ian Elliott, Google
- James Jones, NVIDIA
- Jeff Juliano, NVIDIA
- Daniel Rakos, AMD
- Daniel Stone, Collabora
- Daniel Vetter, Intel
- Aric Cyr, AMD
- Faith Ekstrand, Intel
- Nicolai Hähnle, AMD
- Alon Or-Bach, Samsung
- Niklas Smedberg, Unity Technologies
- Tobias Hector, AMD
- Lionel Duc, NVIDIA
- Lina Versace, Google
- Sebastian Wick, Red Hat
- Jakob Bornecrantz, Collabora
- David Kvasnica, NVIDIA
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.
New Commands
getSwapchainTimeDomainPropertiesEXTgetSwapchainTimingPropertiesEXTsetSwapchainPresentTimingQueueSizeEXT
New Structures
PastPresentationTimingInfoEXTPastPresentationTimingPropertiesEXTPresentStageTimeEXTPresentTimingInfoEXTSwapchainTimeDomainPropertiesEXTSwapchainTimingPropertiesEXTExtending
CalibratedTimestampInfoKHR:Extending
PhysicalDeviceFeatures2,DeviceCreateInfo:Extending
PresentInfoKHR:Extending
SurfaceCapabilities2KHR:
New Enums
New Bitmasks
New Enum Constants
EXT_PRESENT_TIMING_SPEC_VERSIONExtending
Result:Extending
StructureType:STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_EXTSTRUCTURE_TYPE_PAST_PRESENTATION_TIMING_INFO_EXTSTRUCTURE_TYPE_PAST_PRESENTATION_TIMING_PROPERTIES_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXTSTRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXTSTRUCTURE_TYPE_PRESENT_TIMING_INFO_EXTSTRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXTSTRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXTSTRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXTSTRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT
Extending
SwapchainCreateFlagBitsKHR:Extending
TimeDomainKHR:
Issues
1) How does the application determine refresh duration, quanta for change, whether FRR vs. VRR, etc.
The query returns two values: 1) a refresh-cycle duration
(refreshDuration), and 2) an indication whether the timing is
currently fixed (FRR) or variable (VRR). If refreshDuration is zero,
the platform cannot supply these values until after at least one
queuePresentKHR has been done, from
this time (e.g. if queuePresentKHR
has been previously called for this swapchain, at least one additional
call must be made). After calling
queuePresentKHR, the query can be
repeated until refreshDuration is non-zero, at which point the FRR vs.
VRR indication will also be valid.
If the presentation engine’s refreshDuration is a fixed value, the
application’s image present duration (IPD) should be a multiple of
refreshDuration. That is, the quanta for changing the IPD is
refreshDuration. For example, if refreshDuration is 16.67ms, the IPD
can be 16.67ms, 33.33ms, 50.0ms, etc.
If the presentation engine’s refreshDuration is variable,
refreshDuration is the minimum value of the application’s IPD, and the
IPD can be larger by any quanta that is meaningful to the application.
For example, if the refreshDuration is 10ms (i.e. the maximum refresh
rate is 100Hz), the application can choose an IPD of 11ms, 13.33ms,
13.5ms, or 66.0ms; any value greater than or equal to 10ms is valid.
There may be negative consequences for choosing an IPD that is too high,
as the presentation engine may actually have a practical maximum
refreshDuration, where it needs to display the previous image again,
and during this time the presentation engine might delay displaying a
newly-presented image.
FRR displays on at least one platform (Wayland) are not necessarily fixed; but can change over time. For example, if a full-screen video player application is visible, the display may operate at a 24Hz refresh cycle; and then later switch to 60Hz when multiple windows are visible.
VRR displays on some platforms can also be seen as having different characteristics over time. For example, if an application’s window is full-screen-exclusive (i.e. no other window or window system component is visible), the display can look like a VRR display (however that is defined). If the application’s window is not full-screen-exclusive (e.g. a normal multi-window case), the display can look like an FRR display (i.e. because the compositor is trying to treat all windows in a consistent manner). A different issue will deal with how the timing characteristics can change over time.
2) Do we return min/max values for refresh duration for VRR?
Return only the minimum value of refreshDuration for a VRR.
VRR displays have a minimum and maximum refresh rate, and therefore a minimum and maximum refreshDuration. It has been asserted that the display effectively does not have a minimum refresh rate. That is because if an application does not present soon enough, the display hardware will automatically re-display the previous image. However, when the display does that, an application cannot present a new image for a certain period of time. It is unclear about whether that period is large enough to cause visual artifacts.
3) How to deal with changes in timing properties?
RESOLVED: The PastPresentationTimingPropertiesEXT structure that
is returned by getPastPresentationTimingEXT contains
timeDomainsCounter, which is incremented if the time domain enabled
for the swapchain is not currently available.
An example of why display timing properties can change is if a surface changes from being a window that’s a subset of the display size, to becoming full-screen-exclusive. While the surface was a subset of the display, a compositor might enforce fixed timings on the surface (e.g. FRR of 60Hz), where the presentation engine might be free to allow VRR behavior of a full-screen-exclusive surface.
It is possible that a full-screen-exclusive window can become temporarily obscured (e.g. when a short-term dialog pops up). In this case, the surface might use FRR timings while the dialog is visible and VRR otherwise.
4) One Query for all Timing info vs. an initial query to determine FRR vs. VRR, and then FRR-specific vs VRR-specific queries?
RESOLVED: Have one query, as described in issue 1, that can be called whenever the application needs to obtain the timing properties of the surface.
5) Query to determine time domain?
RESOLVED: Have a query to determine the time domain. This extension defines a basic swapchain-local time domain. Other extensions can add other platform-specific time domains.
6) What time to use for targetPresentTime for early images?
RESOLVED: Have no query for determining the current time in the PE’s time domain; and do allow the special value of zero for targetPresentTime, meaning that there is no target.
On some platforms, there is no way to determine the current time, nor to determine surface timing properties until after at least one image has been presented.
In such cases, the special value of zero allows the application to indicate that timing feedback is desired, but that no targetPresentTime is requested. Later, once the application has obtained feedback, it can specify targetPresentTime by using the result’s actualPresentTime.
7) How long before an application’s request for new image duration is honored?
Apparently, changes to some vendors' display hardware settings do not take effect immediately. It is not clear what settings, and therefore, it is not clear how to address this issue.
8) Do we have a query for the anticipated latency from present to feedback?
RESOLVED: Do not provide a query for the feedback latency.
There is some amount of latency from when an application calls vkQueuePresentKHR to when the image is displayed to the user, to when feedback is available to the application on when the image was actually displayed to the user. The first time (from the call till the image is presented) generally doesn’t matter, because the application will likely be providing a targetPresentTime (i.e. the application may have some indication for how long this will be). However, the latency between targetPresentTime until feedback is available may be much longer. For example, on Android on the 1st-generation Pixel phone (60Hz FRR display), the latency was approximately 5 refresh cycles (83.33ms). For higher-frequency displays, the latency may have a larger number of refresh cycles.
9) Do we have a query(s) about the number of VkPastPresentationTimingEXT structs to keep?
RESOLVED: Do not provide a query for the number of results the swapchain is allowed to store before querying them with vkGetPastPresentationTimingEXT. Let the application specify that value with a dedicated API.
10) How is the SWAPCHAIN_LOCAL and STAGE_LOCAL time domain used with the calibrated timestamps extension?
RESOLVED: Define a struct to chain into VkCalibratedTimestampInfoEXT::pNext that specifies a swapchain and present stage.
11) Should VK_PRESENT_MODE_FIFO_LATEST_READY_EXT be part of this extension, or split out into its own extension?
RESOLVED: It is only tangentially related. Split it out into its own extension and define the interaction here.
Version History
Revision 1, 2018-05-11 (Ian Elliott)
- Internal revisions.
Revision 2, 2022-11-30 (Lionel Duc)
- Rebase for public discussions.
Revision 3, 2024-10-09 (Lionel Duc)
- Public 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.
Synopsis
- setSwapchainPresentTimingQueueSizeEXT :: MonadIO io => Device -> SwapchainKHR -> ("size" ::: Word32) -> io Result
- getSwapchainTimingPropertiesEXT :: MonadIO io => Device -> SwapchainKHR -> io (Result, SwapchainTimingPropertiesEXT, "swapchainTimingPropertiesCounter" ::: Word64)
- getSwapchainTimeDomainPropertiesEXT :: MonadIO io => Device -> SwapchainKHR -> io (Result, SwapchainTimeDomainPropertiesEXT, "timeDomainsCounter" ::: Word64)
- getPastPresentationTimingEXT :: MonadIO io => Device -> PastPresentationTimingInfoEXT -> io (Result, PastPresentationTimingPropertiesEXT)
- data PhysicalDevicePresentTimingFeaturesEXT = PhysicalDevicePresentTimingFeaturesEXT {}
- data PresentTimingSurfaceCapabilitiesEXT = PresentTimingSurfaceCapabilitiesEXT {}
- data SwapchainTimingPropertiesEXT = SwapchainTimingPropertiesEXT {}
- data SwapchainTimeDomainPropertiesEXT = SwapchainTimeDomainPropertiesEXT {}
- data PresentStageTimeEXT = PresentStageTimeEXT {}
- data PastPresentationTimingInfoEXT = PastPresentationTimingInfoEXT {}
- data PastPresentationTimingPropertiesEXT = PastPresentationTimingPropertiesEXT {}
- data PastPresentationTimingEXT = PastPresentationTimingEXT {}
- data PresentTimingsInfoEXT = PresentTimingsInfoEXT {}
- data PresentTimingInfoEXT = PresentTimingInfoEXT {}
- data SwapchainCalibratedTimestampInfoEXT = SwapchainCalibratedTimestampInfoEXT {}
- newtype TimeDomainKHR where
- TimeDomainKHR Int32
- pattern TIME_DOMAIN_DEVICE_KHR :: TimeDomainKHR
- pattern TIME_DOMAIN_CLOCK_MONOTONIC_KHR :: TimeDomainKHR
- pattern TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR :: TimeDomainKHR
- pattern TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR :: TimeDomainKHR
- pattern TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT :: TimeDomainKHR
- pattern TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT :: TimeDomainKHR
- type PresentStageFlagsEXT = PresentStageFlagBitsEXT
- newtype PresentStageFlagBitsEXT where
- PresentStageFlagBitsEXT Flags
- pattern PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT :: PresentStageFlagBitsEXT
- pattern PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT :: PresentStageFlagBitsEXT
- pattern PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT :: PresentStageFlagBitsEXT
- pattern PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT :: PresentStageFlagBitsEXT
- type PastPresentationTimingFlagsEXT = PastPresentationTimingFlagBitsEXT
- newtype PastPresentationTimingFlagBitsEXT where
- type PresentTimingInfoFlagsEXT = PresentTimingInfoFlagBitsEXT
- newtype PresentTimingInfoFlagBitsEXT where
- type EXT_PRESENT_TIMING_SPEC_VERSION = 3
- pattern EXT_PRESENT_TIMING_SPEC_VERSION :: Integral a => a
- type EXT_PRESENT_TIMING_EXTENSION_NAME = "VK_EXT_present_timing"
- pattern EXT_PRESENT_TIMING_EXTENSION_NAME :: (Eq a, IsString a) => a
- newtype SwapchainKHR = SwapchainKHR Word64
- newtype SwapchainCreateFlagBitsKHR where
- SwapchainCreateFlagBitsKHR Flags
- pattern SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PROTECTED_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR :: SwapchainCreateFlagBitsKHR
- type SwapchainCreateFlagsKHR = SwapchainCreateFlagBitsKHR
Documentation
setSwapchainPresentTimingQueueSizeEXT Source #
Arguments
| :: MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> ("size" ::: Word32) |
|
| -> io Result |
vkSetSwapchainPresentTimingQueueSizeEXT - Allocate memory for the swapchain-internal timing results queue
Description
If this function is called multiple times, the internal queue is
reallocated to fit the new size. If the new size is less than the
current number of outstanding results,
NOT_READY is returned and no allocation is
performed.
Valid Usage
-
swapchainmust have been created withSwapchainCreateInfoKHR::flagscontainingSWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
swapchainmust be a validSwapchainKHRhandle -
swapchainmust have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
swapchainmust be externally synchronized
Return Codes
See Also
getSwapchainTimingPropertiesEXT Source #
Arguments
| :: MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> io (Result, SwapchainTimingPropertiesEXT, "swapchainTimingPropertiesCounter" ::: Word64) |
vkGetSwapchainTimingPropertiesEXT - Obtain the display timing properties of the PE’s display
Description
If getSwapchainTimingPropertiesEXT returns
NOT_READY, the implementation was not able
to determine the current refresh cycle duration. Some platforms may
not provide timing properties until after at least one image has been
presented to the swapchain. If timing properties change for the
swapchain, these platforms may not provide updated results until
after at least one additional image has been presented to the
swapchain.
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
swapchainmust be a validSwapchainKHRhandle -
pSwapchainTimingPropertiesmust be a valid pointer to aSwapchainTimingPropertiesEXTstructure -
If
pSwapchainTimingPropertiesCounteris notNULL,pSwapchainTimingPropertiesCountermust be a valid pointer to auint64_tvalue -
swapchainmust have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
swapchainmust be externally synchronized
Return Codes
See Also
VK_EXT_present_timing,
Device,
SwapchainKHR, SwapchainTimingPropertiesEXT
getSwapchainTimeDomainPropertiesEXT Source #
Arguments
| :: MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> io (Result, SwapchainTimeDomainPropertiesEXT, "timeDomainsCounter" ::: Word64) |
vkGetSwapchainTimeDomainPropertiesEXT - Obtain the time domains supported by the PE for the swapchain
Description
If upon return SwapchainTimeDomainPropertiesEXT::timeDomainCount is
smaller than the number of time domains supported for the given
swapchain, INCOMPLETE will be returned
instead of SUCCESS to indicate that not all
the available values were returned.
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
swapchainmust be a validSwapchainKHRhandle -
pSwapchainTimeDomainPropertiesmust be a valid pointer to aSwapchainTimeDomainPropertiesEXTstructure -
If
pTimeDomainsCounteris notNULL,pTimeDomainsCountermust be a valid pointer to auint64_tvalue -
swapchainmust have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
swapchainmust be externally synchronized
Return Codes
See Also
VK_EXT_present_timing,
Device,
SwapchainKHR,
SwapchainTimeDomainPropertiesEXT
getPastPresentationTimingEXT Source #
Arguments
| :: MonadIO io | |
| => Device |
|
| -> PastPresentationTimingInfoEXT |
|
| -> io (Result, PastPresentationTimingPropertiesEXT) |
vkGetPastPresentationTimingEXT - Obtain timing of previously-presented images
Description
If upon return the value of
PastPresentationTimingPropertiesEXT::presentationTimingCount is less
than the number of available timing records for the given
PastPresentationTimingInfoEXT::swapchain,
INCOMPLETE is returned instead of
SUCCESS to indicate that not all the
available values were returned.
Upon return, zero or more slots of the swapchain internal timing
results queue, equal to the number of entries written to
PastPresentationTimingPropertiesEXT::pPresentationTimings for which
reportComplete is TRUE, are made
available for future
queuePresentKHR calls. Elements of
pPresentationTimings are arranged in ascending order of present ids.
Timing information may become available out of order with regards to
their associated queuePresentKHR
order. PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT
can be set in PastPresentationTimingInfoEXT::flags to allow
getPastPresentationTimingEXT to return results in that same order.
Otherwise, results are returned in the order of their associated
queuePresentKHR calls.
There is no requirement for any precise timing relationship between the completion of a present stage and the availability of any associated timing information. However, results must be made available in finite time.
As an exception to the normal rules for objects which are externally
synchronized, swapchain may be simultaneously used by other threads
in calls to functions other than
destroySwapchainKHR and
createSwapchainKHR with swapchain
used as an oldSwapchain. Access to the swapchain timing information
must be atomic within the implementation.
Valid Usage
- If
PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXTis set inPastPresentationTimingInfoEXT::flags, thepresentStageCountvalue of each element ofPastPresentationTimingPropertiesEXT::pPresentationTimingsmust be at least the maximum number of present stages set inPresentTimingInfoEXT::presentStageQueriesamong allqueuePresentKHRcalls, with a non-zeropresentStageQueries, for which complete results have not been returned yet by a previous call
- If
PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXTis not set inPastPresentationTimingInfoEXT::flags, thepresentStageCountvalue of each element ofPastPresentationTimingPropertiesEXT::pPresentationTimingsmust be at least the number of present stages set inPresentTimingInfoEXT::presentStageQueriesfor the earliest call toqueuePresentKHR, with a non-zeropresentStageQueries, that corresponds to that element’s index and for which complete results have not been returned yet by a previous call
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pPastPresentationTimingInfomust be a valid pointer to a validPastPresentationTimingInfoEXTstructure -
pPastPresentationTimingPropertiesmust be a valid pointer to aPastPresentationTimingPropertiesEXTstructure
Return Codes
See Also
VK_EXT_present_timing,
Device, PastPresentationTimingInfoEXT,
PastPresentationTimingPropertiesEXT
data PhysicalDevicePresentTimingFeaturesEXT Source #
VkPhysicalDevicePresentTimingFeaturesEXT - Structure indicating support for present timing
Members
This structure describes the following feature:
Description
If the PhysicalDevicePresentTimingFeaturesEXT structure is included in
the pNext chain of the
PhysicalDeviceFeatures2
structure passed to
getPhysicalDeviceFeatures2,
it is filled in to indicate whether each corresponding feature is
supported. If the application wishes to use a
Device with any features described by
PhysicalDevicePresentTimingFeaturesEXT, it must add an instance of
the structure, with the desired feature members set to
TRUE, to the pNext chain of
DeviceCreateInfo when creating the
Device.
Valid Usage (Implicit)
See Also
Constructors
| PhysicalDevicePresentTimingFeaturesEXT | |
Fields
| |
Instances
data PresentTimingSurfaceCapabilitiesEXT Source #
VkPresentTimingSurfaceCapabilitiesEXT - Structure describing present timing capabilities of a surface
Valid Usage (Implicit)
See Also
VK_EXT_present_timing,
Bool32, PresentStageFlagsEXT,
StructureType
Constructors
| PresentTimingSurfaceCapabilitiesEXT | |
Fields
| |
Instances
data SwapchainTimingPropertiesEXT Source #
VkSwapchainTimingPropertiesEXT - Structure containing the RC duration of a display
Description
If refreshDuration is zero, the presentation engine is not able to
determine the duration of the refresh cycle. Similarly, if
refreshInterval is zero, the presentation engine is not able to
determine whether it is operating in VRR mode.
Otherwise, if refreshInterval is the same as refreshDuration, the
presentation engine is operating in FRR mode. In this case,
refreshDuration is the number of nanoseconds from the start of one
refresh cycle to the start of the next refresh cycle.
If refreshInterval is UINT64_MAX, the presentation engine is
operating in VRR mode, and refreshDuration is the minimum number of
nanoseconds from the start of one refresh cycle to the start of the next
refresh cycle.
If refreshDuration and refreshInterval are not zero,
refreshInterval is a factor of refreshDuration.
Valid Usage (Implicit)
See Also
VK_EXT_present_timing,
StructureType,
getSwapchainTimingPropertiesEXT
Constructors
| SwapchainTimingPropertiesEXT | |
Fields
| |
Instances
data SwapchainTimeDomainPropertiesEXT Source #
VkSwapchainTimeDomainPropertiesEXT - List of available time domains for a swapchain
Description
When calling getSwapchainTimeDomainPropertiesEXT, if pTimeDomains is
NULL and pTimeDomainIds is NULL, then the number of time domains
supported for the given swapchain is returned in timeDomainCount.
Otherwise, timeDomainCount must specify the number of elements in
pTimeDomains and pTimeDomainIds, and on return is overwritten with
the number of values actually written to each array.
Due to the dynamic nature of their underlying
SurfaceKHR properties, swapchains may need
to expose multiple swapchain-local opaque time domains using the same
TimeDomainKHR value over time, for example when a surface is moved
from one display hardware to another. Arbitrary identifiers, provided in
timeDomainIds, are used by the implementation to differentiate opaque
time domains of identical scopes.
Valid Usage
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT
See Also
VK_EXT_present_timing,
StructureType, TimeDomainKHR,
getSwapchainTimeDomainPropertiesEXT
Constructors
| SwapchainTimeDomainPropertiesEXT | |
Fields
| |
Instances
data PresentStageTimeEXT Source #
VkPresentStageTimeEXT - Associate a present stage with a timestamp
See Also
VK_EXT_present_timing,
PastPresentationTimingEXT, PresentStageFlagsEXT
Constructors
| PresentStageTimeEXT | |
Fields
| |
Instances
data PastPresentationTimingInfoEXT Source #
VkPastPresentationTimingInfoEXT - Structure specifying swapchain present timing query parameters
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_PAST_PRESENTATION_TIMING_INFO_EXT
-
pNextmust beNULL -
flagsmust be a valid combination ofPastPresentationTimingFlagBitsEXTvalues -
swapchainmust be a validSwapchainKHRhandle
Host Synchronization
- Host access to
swapchainmust be externally synchronized
See Also
VK_EXT_present_timing,
PastPresentationTimingFlagsEXT,
StructureType,
SwapchainKHR, getPastPresentationTimingEXT
Constructors
| PastPresentationTimingInfoEXT | |
Fields
| |
Instances
data PastPresentationTimingPropertiesEXT Source #
VkPastPresentationTimingPropertiesEXT - Structure containing details about a swapchain past presentation activity
Description
When calling getPastPresentationTimingEXT, if pPresentationTimings
is NULL, then the number of available timing records for the given
swapchain is returned in presentationTimingCount. Otherwise,
presentationTimingCount must specify the number of elements in the
pPresentationTimings array, and on return is overwritten with the
number of structures actually written to pPresentationTimings.
if PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT is specified
in PastPresentationTimingInfoEXT::flags,
getPastPresentationTimingEXT may return incomplete results,
containing only information for a subset of the requested present
stages. Further calls to getPastPresentationTimingEXT will keep
providing all available results for a previously incomplete entry until
it is complete.
The implementation must return a PastPresentationTimingEXT for every
queuePresentKHR referencing
swapchain where a non-zero
PresentTimingInfoEXT::presentStageQueries was specified and at least
one present stage has available results.
Valid Usage (Implicit)
See Also
VK_EXT_present_timing,
PastPresentationTimingEXT,
StructureType,
getPastPresentationTimingEXT
Constructors
| PastPresentationTimingPropertiesEXT | |
Fields
| |
Instances
data PastPresentationTimingEXT Source #
VkPastPresentationTimingEXT - Structure containing timing information about a previously-presented image
Description
When calling getPastPresentationTimingEXT, the implementation sets
presentStageCount to the number of present stages it has written
results for. If PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT
was specified in PastPresentationTimingInfoEXT::flags, the
implementation may return an incomplete report containing fewer
present stage results than were queried by the associated presentation
request. Otherwise, results for all the present stages queried by the
presentation request are written by the implementation.
Timing information for some present stages may have a time value of 0, indicating that results for that present stage are not available.
For systems with multiple entities operating within the presentation
engine, such as multiple displays, pPresentStages will return timing
results for one entity which has been affected by the presentation.
timeDomainId may be different than the time domain that was
specified in PresentTimingInfoEXT::timeDomainId if the requirements
for using this time domain could not be met at the time the presentation
engine processed the presentation request. In such a case, the
presentation engine may pick a time domain to fall back to, if one is
available, and report results in that domain. Applications can
continue to use this fallback time domain in future
queuePresentKHR calls, or they
can call getSwapchainTimeDomainPropertiesEXT to choose from the
currently supported time domains.
Valid Usage (Implicit)
See Also
VK_EXT_present_timing,
Bool32,
PastPresentationTimingPropertiesEXT, PresentStageTimeEXT,
StructureType, TimeDomainKHR
Constructors
| PastPresentationTimingEXT | |
Fields
| |
Instances
data PresentTimingsInfoEXT Source #
VkPresentTimingsInfoEXT - Array of VkPresentTimingInfoEXT to chain with VkPresentInfoKHR
Valid Usage
-
swapchainCountmust be equal toPresentInfoKHR::swapchainCount
- All swapchains in
PresentInfoKHR::pSwapchainsmust have been created with theSwapchainCreateInfoKHR::flagsfield containingSWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT - For each member of
PresentInfoKHR::pSwapchains, if the associatedPresentTimingInfoEXT::targetTimeis not zero, the swapchain’s current present mode must bePRESENT_MODE_FIFO_LATEST_READY_KHR,PRESENT_MODE_FIFO_KHRorPRESENT_MODE_FIFO_RELAXED_KHR
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT
- If
pTimingInfosis notNULL,pTimingInfosmust be a valid pointer to an array ofswapchainCountvalidPresentTimingInfoEXTstructures -
swapchainCountmust be greater than0
See Also
Constructors
| PresentTimingsInfoEXT | |
Fields
| |
Instances
| Show PresentTimingsInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_present_timing Methods showsPrec :: Int -> PresentTimingsInfoEXT -> ShowS # show :: PresentTimingsInfoEXT -> String # showList :: [PresentTimingsInfoEXT] -> ShowS # | |
| FromCStruct PresentTimingsInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_present_timing Methods peekCStruct :: Ptr PresentTimingsInfoEXT -> IO PresentTimingsInfoEXT Source # | |
| ToCStruct PresentTimingsInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_present_timing Methods withCStruct :: PresentTimingsInfoEXT -> (Ptr PresentTimingsInfoEXT -> IO b) -> IO b Source # pokeCStruct :: Ptr PresentTimingsInfoEXT -> PresentTimingsInfoEXT -> IO b -> IO b Source # withZeroCStruct :: (Ptr PresentTimingsInfoEXT -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr PresentTimingsInfoEXT -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero PresentTimingsInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_present_timing Methods | |
data PresentTimingInfoEXT Source #
VkPresentTimingInfoEXT - Specifies per-present timing information
Description
If targetTime is not zero, the implementation attempts to align the
PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT present stage of that
presentation request with the time specified in targetTime according
to the time domain used. If
PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT is not
set in flags, it indicates that the application would strictly prefer
the image to not be visible before targetTime has lapsed.
If targetTime is not zero and timeDomainId is associated with a
TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT time domain,
targetTimeDomainPresentStage is used to specify which present stage’s
time domain targetTime is specified for. Otherwise,
targetTimeDomainPresentStage is ignored.
Some platforms, due to hardware or system limitations, may not be able
to accurately time targetTime with the actual physical event of the
image becoming visible on the display. However, those timing
capabilities may still be useful and result in improved animation
quality.
As such, the
presentAtAbsoluteTime
and
presentAtRelativeTime
features do not provide a strict guarantee regarding the completion of
the PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT present stage
relative to the targetTime, and implementations must strive to make
it as consistent and accurate as possible.
Applications that specify an absolute present time should regularly
rebase their calculations for their next target time on the feedback
from getPastPresentationTimingEXT to compensate for accumulated
precision errors or potential clock drift. It is recommended that when
targeting the time of a vertical blanking period, applications set
PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT to allow
the implementation to compensate for small precision errors that may
cause an image to be displayed one refresh cycle later than intended.
Valid Usage
- If
targetTimeis not zero andflagsdoes not containPRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT, the presentAtAbsoluteTime feature must be enabled and thepresentAtAbsoluteTimeSupportedmember of thePresentTimingSurfaceCapabilitiesEXTreturned bygetPhysicalDeviceSurfaceCapabilities2KHRfor the surface associated with the swapchain must beTRUE
- If
targetTimeis not zero andflagscontainsPRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT, the presentAtRelativeTime feature must be enabled and thepresentAtRelativeTimeSupportedmember of thePresentTimingSurfaceCapabilitiesEXTreturned bygetPhysicalDeviceSurfaceCapabilities2KHRfor the surface associated with the swapchain must beTRUE - If
timeDomainIdis associated with aTIME_DOMAIN_PRESENT_STAGE_LOCAL_EXTtime domain, andtargetTimeis not zero,targetTimeDomainPresentStagemust be a singlePresentStageFlagsEXTvalue
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT
-
pNextmust beNULL -
flagsmust be a valid combination ofPresentTimingInfoFlagBitsEXTvalues -
presentStageQueriesmust be a valid combination ofPresentStageFlagBitsEXTvalues -
targetTimeDomainPresentStagemust be a valid combination ofPresentStageFlagBitsEXTvalues
See Also
VK_EXT_present_timing,
PresentStageFlagsEXT, PresentTimingInfoFlagsEXT,
PresentTimingsInfoEXT,
StructureType
Constructors
| PresentTimingInfoEXT | |
Fields
| |
Instances
data SwapchainCalibratedTimestampInfoEXT Source #
VkSwapchainCalibratedTimestampInfoEXT - Structure specifying the swapchain to calibrate a swapchain-local timestamp query
Description
timeDomainId must be an id previously reported by
getSwapchainTimeDomainPropertiesEXT for swapchain. If the
timeDomainId is no longer supported by the swapchain,
implementations may report zero as the calibrated timestamp value.
Valid Usage
- If the
timeDomainmember of theCalibratedTimestampInfoKHRstructure in this structure’spNextchain isTIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT,presentStagemust specify one and only one present stage
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT
-
swapchainmust be a validSwapchainKHRhandle -
presentStagemust be a valid combination ofPresentStageFlagBitsEXTvalues -
presentStagemust not be0
Host Synchronization
- Host access to
swapchainmust be externally synchronized
See Also
VK_EXT_present_timing,
PresentStageFlagsEXT,
StructureType,
SwapchainKHR
Constructors
| SwapchainCalibratedTimestampInfoEXT | |
Fields
| |
Instances
newtype TimeDomainKHR Source #
VkTimeDomainKHR - Supported time domains
Description
TIME_DOMAIN_DEVICE_KHRspecifies the device time domain. Timestamp values in this time domain use the same units and are comparable with device timestamp values captured usingcmdWriteTimestamporcmdWriteTimestamp2and are defined to be incrementing according to the timestampPeriod of the device.
TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXTspecifies a time domain unique to a particular swapchain and a specific present stage. Timestamp values in this time domain are in units of nanosecond and are comparable only with other values from the same swapchain and present stage.TIME_DOMAIN_SWAPCHAIN_LOCAL_EXTspecifies a time domain unique to a particular swapchain. Timestamp values in this time domain are in units of nanosecond and are comparable only with other values from the same swapchain.TIME_DOMAIN_CLOCK_MONOTONIC_KHRspecifies the CLOCK_MONOTONIC time domain available on POSIX platforms. Timestamp values in this time domain are in units of nanoseconds and are comparable with platform timestamp values captured using the POSIX clock_gettime API as computed by this example:
An implementation supporting VK_KHR_calibrated_timestamps or
VK_EXT_calibrated_timestamps will use the same time domain for all its
Queue so that timestamp values reported for
TIME_DOMAIN_DEVICE_KHR can be matched to any timestamp captured
through cmdWriteTimestamp or
cmdWriteTimestamp2
.
struct timespec tv; clock_gettime(CLOCK_MONOTONIC, &tv); return tv.tv_nsec + tv.tv_sec*1000000000ull;
TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHRspecifies the CLOCK_MONOTONIC_RAW time domain available on POSIX platforms. Timestamp values in this time domain are in units of nanoseconds and are comparable with platform timestamp values captured using the POSIX clock_gettime API as computed by this example:
struct timespec tv; clock_gettime(CLOCK_MONOTONIC_RAW, &tv); return tv.tv_nsec + tv.tv_sec*1000000000ull;
TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHRspecifies the performance counter (QPC) time domain available on Windows. Timestamp values in this time domain are in the same units as those provided by the Windows QueryPerformanceCounter API and are comparable with platform timestamp values captured using that API as computed by this example:
LARGE_INTEGER counter; QueryPerformanceCounter(&counter); return counter.QuadPart;
See Also
VK_EXT_calibrated_timestamps,
VK_KHR_calibrated_timestamps,
CalibratedTimestampInfoKHR,
PastPresentationTimingEXT, SwapchainTimeDomainPropertiesEXT,
getPhysicalDeviceCalibrateableTimeDomainsKHR,
getPhysicalDeviceCalibrateableTimeDomainsKHR
Constructors
| TimeDomainKHR Int32 |
Bundled Patterns
| pattern TIME_DOMAIN_DEVICE_KHR :: TimeDomainKHR | |
| pattern TIME_DOMAIN_CLOCK_MONOTONIC_KHR :: TimeDomainKHR | |
| pattern TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR :: TimeDomainKHR | |
| pattern TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR :: TimeDomainKHR | |
| pattern TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT :: TimeDomainKHR | |
| pattern TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT :: TimeDomainKHR |
Instances
newtype PresentStageFlagBitsEXT Source #
VkPresentStageFlagBitsEXT - Bitmask specifying stages of the image presentation process
Description
PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXTmarks the end of the set of queue operations enqueued byqueuePresentKHRon the providedQueuefor a presentation request.
PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXTis the stage after which the presentation request has been dequeued from the swapchain’s internal presentation request queue, if any, as specified by the present mode associated with that request.PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXTis the stage after which data for the first pixel of the presentation request associated with the image has left the presentation engine for a display hardware.PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXTis the stage after which a display hardware has made the first pixel visible for the presentation request associated with the image to be presented.
The set of queue operations delimited by
PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT includes the wait for the
semaphores specified in
PresentInfoKHR::pWaitSemaphores,
if any, and any work implicitly enqueued by the implementation.
See Also
Constructors
| PresentStageFlagBitsEXT Flags |
Bundled Patterns
Instances
newtype PastPresentationTimingFlagBitsEXT Source #
VkPastPresentationTimingFlagBitsEXT - Bitmask specifying past presentation timing query flags
Description
PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXTspecifies thatgetPastPresentationTimingEXTmay return partial results for presentation requests that have not completed all requested present stages.
PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXTspecifies thatgetPastPresentationTimingEXTmay return results out of order with respect to the presentation order.
See Also
Constructors
| PastPresentationTimingFlagBitsEXT Flags |
Bundled Patterns
Instances
newtype PresentTimingInfoFlagBitsEXT Source #
VkPresentTimingInfoFlagBitsEXT - Bitmask specifying present timing info flags
Description
PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXTspecifies thatPresentTimingInfoEXT::targetTimeis to be interpreted as a relative time from the previous presentation’sPRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXTstage. If theswapchainhas never been used to present an image, the providedtargetTimeis ignored.
PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXTspecifies that the application would prefer the image to be presented earlier than the time specified inPresentTimingInfoEXT::targetTimeif that time falls within the first half of a refresh cycle. In that case, the presentation engine may choose to display the image at the start of that refresh cycle.
See Also
Constructors
| PresentTimingInfoFlagBitsEXT Flags |
Bundled Patterns
| pattern PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT :: PresentTimingInfoFlagBitsEXT | |
| pattern PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT :: PresentTimingInfoFlagBitsEXT |
Instances
type EXT_PRESENT_TIMING_SPEC_VERSION = 3 Source #
pattern EXT_PRESENT_TIMING_SPEC_VERSION :: Integral a => a Source #
type EXT_PRESENT_TIMING_EXTENSION_NAME = "VK_EXT_present_timing" Source #
pattern EXT_PRESENT_TIMING_EXTENSION_NAME :: (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.
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
| SwapchainKHR Word64 |
Instances
newtype SwapchainCreateFlagBitsKHR Source #
VkSwapchainCreateFlagBitsKHR - Bitmask controlling swapchain creation
Description
SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHRspecifies that images created from the swapchain (i.e. with theswapchainmember ofImageSwapchainCreateInfoKHRset to this swapchain’s handle) must useIMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT.
SWAPCHAIN_CREATE_PROTECTED_BIT_KHRspecifies that images created from the swapchain are protected images.SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHRspecifies that the images of the swapchain can be used to create aImageViewwith a different format than what the swapchain was created with. The list of allowed image view formats is specified by adding aImageFormatListCreateInfostructure to thepNextchain ofSwapchainCreateInfoKHR. In addition, this flag also specifies that the swapchain can be created with usage flags that are not supported for the format the swapchain is created with but are supported for at least one of the allowed image view formats.SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_KHRspecifies that the implementation may defer allocation of memory associated with each swapchain image until its index is to be returned fromacquireNextImageKHRoracquireNextImage2KHRfor the first time.SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHRspecifies that applications can include thePresentId2KHRstructure in thepNextchain of thePresentInfoKHRstructure to associate an identifier with each presentation request.SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHRspecifies that applications can usewaitForPresent2KHRto wait for the presentation engine to have begun presentation of the presentation request associated withPresentWait2InfoKHR::presentIdonswapchain.SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXTspecifies that features supported by the swapchain device inPhysicalDevicePresentTimingFeaturesEXTcan be used to collect timing information or schedule presentation requests at specific times.
See Also
Constructors
| SwapchainCreateFlagBitsKHR Flags |
Bundled Patterns