Safe Haskell | None |
---|---|
Language | Haskell2010 |
Name
VK_EXT_calibrated_timestamps - device extension
VK_EXT_calibrated_timestamps
- Name String
VK_EXT_calibrated_timestamps
- Extension Type
- Device extension
- Registered Extension Number
- 185
- Revision
- 2
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_get_physical_device_properties2
- Contact
Other Extension Metadata
- Last Modified Date
- 2018-10-04
- IP Status
- No known IP claims.
- Contributors
- Matthaeus G. Chajdas, AMD
- Alan Harrison, AMD
- Derrick Owens, AMD
- Daniel Rakos, AMD
- Jason Ekstrand, Intel
- Keith Packard, Valve
Description
This extension provides an interface to query calibrated timestamps obtained quasi simultaneously from two time domains.
New Commands
New Structures
New Enums
New Enum Constants
Issues
1) Is the device timestamp value returned in the same time domain as the
timestamp values written by
cmdWriteTimestamp
?
RESOLVED: Yes.
2) What time domain is the host timestamp returned in?
RESOLVED: A query is provided to determine the calibrateable time domains. The expected host time domain used on Windows is that of QueryPerformanceCounter, and on Linux that of CLOCK_MONOTONIC.
3) Should we support other time domain combinations than just one host and the device time domain?
RESOLVED: Supporting that would need the application to query the set of supported time domains, while supporting only one host and the device time domain would only need a query for the host time domain type. The proposed API chooses the general approach for the sake of extensibility.
4) Should we use CLOCK_MONOTONIC_RAW instead of CLOCK_MONOTONIC?
RESOLVED: CLOCK_MONOTONIC is usable in a wider set of situations, however, it is subject to NTP adjustments so some use cases may prefer CLOCK_MONOTONIC_RAW. Thus this extension allows both to be exposed.
5) How can the application extrapolate future device timestamp values from the calibrated timestamp value?
RESOLVED:
PhysicalDeviceLimits
::timestampPeriod
makes it possible to calculate future device timestamps as follows:
6) In what queue are timestamp values in time domain
TIME_DOMAIN_DEVICE_EXT
captured by getCalibratedTimestampsEXT
?
RESOLVED: An implementation supporting this extension will have all its VkQueue share the same time domain.
futureTimestamp = calibratedTimestamp + deltaNanoseconds / timestampPeriod
6) Can the host and device timestamp values drift apart over longer periods of time?
RESOLVED: Yes, especially as some time domains by definition allow for that to happen (e.g. CLOCK_MONOTONIC is subject to NTP adjustments). Thus it is recommended that applications re-calibrate from time to time.
7) Should we add a query for reporting the maximum deviation of the timestamp values returned by calibrated timestamp queries?
RESOLVED: A global query seems inappropriate and difficult to enforce. However, it is possible to return the maximum deviation any single calibrated timestamp query can have by sampling one of the time domains twice as follows:
timestampX = timestampX_before = SampleTimeDomain(X) for each time domain Y != X timestampY = SampleTimeDomain(Y) timestampX_after = SampleTimeDomain(X) maxDeviation = timestampX_after - timestampX_before
8) Can the maximum deviation reported ever be zero?
RESOLVED: Unless the tick of each clock corresponding to the set of time domains coincides and all clocks can literally be sampled simutaneously, there is not really a possibility for the maximum deviation to be zero, so by convention the maximum deviation is always at least the maximum of the length of the ticks of the set of time domains calibrated and thus can never be zero.
Version History
Revision 2, 2021-03-16 (Lionel Landwerlin)
- Specify requirement on device timestamps
Revision 1, 2018-10-04 (Daniel Rakos)
- Internal revisions.
See Also
CalibratedTimestampInfoEXT
, TimeDomainEXT
,
getCalibratedTimestampsEXT
,
getPhysicalDeviceCalibrateableTimeDomainsEXT
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
- getPhysicalDeviceCalibrateableTimeDomainsEXT :: forall io. MonadIO io => PhysicalDevice -> io (Result, "timeDomains" ::: Vector TimeDomainEXT)
- getCalibratedTimestampsEXT :: forall io. MonadIO io => Device -> ("timestampInfos" ::: Vector CalibratedTimestampInfoEXT) -> io ("timestamps" ::: Vector Word64, "maxDeviation" ::: Word64)
- data CalibratedTimestampInfoEXT = CalibratedTimestampInfoEXT {}
- newtype TimeDomainEXT where
- type EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION = 2
- pattern EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION :: forall a. Integral a => a
- type EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME = "VK_EXT_calibrated_timestamps"
- pattern EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
getPhysicalDeviceCalibrateableTimeDomainsEXT Source #
:: forall io. MonadIO io | |
=> PhysicalDevice |
|
-> io (Result, "timeDomains" ::: Vector TimeDomainEXT) |
vkGetPhysicalDeviceCalibrateableTimeDomainsEXT - Query calibrateable time domains
Description
If pTimeDomains
is NULL
, then the number of calibrateable time
domains supported for the given physicalDevice
is returned in
pTimeDomainCount
. Otherwise, pTimeDomainCount
must point to a
variable set by the user to the number of elements in the pTimeDomains
array, and on return the variable is overwritten with the number of
values actually written to pTimeDomains
. If the value of
pTimeDomainCount
is less than the number of calibrateable time domains
supported, at most pTimeDomainCount
values will be written to
pTimeDomains
, and INCOMPLETE
will be
returned instead of SUCCESS
, to indicate
that not all the available time domains were returned.
Valid Usage (Implicit)
-
physicalDevice
must be a validPhysicalDevice
handle
-
pTimeDomainCount
must be a valid pointer to auint32_t
value -
If the value referenced by
pTimeDomainCount
is not0
, andpTimeDomains
is notNULL
,pTimeDomains
must be a valid pointer to an array ofpTimeDomainCount
TimeDomainEXT
values
Return Codes
See Also
getCalibratedTimestampsEXT Source #
:: forall io. MonadIO io | |
=> Device |
|
-> ("timestampInfos" ::: Vector CalibratedTimestampInfoEXT) |
|
-> io ("timestamps" ::: Vector Word64, "maxDeviation" ::: Word64) |
vkGetCalibratedTimestampsEXT - Query calibrated timestamps
Description
Note
The maximum deviation may vary between calls to
getCalibratedTimestampsEXT
even for the same set of time domains due
to implementation and platform specific reasons. It is the application’s
responsibility to assess whether the returned maximum deviation makes
the timestamp values suitable for any particular purpose and can
choose to re-issue the timestamp calibration call pursuing a lower
devation value.
Calibrated timestamp values can be extrapolated to estimate future coinciding timestamp values, however, depending on the nature of the time domains and other properties of the platform extrapolating values over a sufficiently long period of time may no longer be accurate enough to fit any particular purpose, so applications are expected to re-calibrate the timestamps on a regular basis.
Return Codes
See Also
data CalibratedTimestampInfoEXT Source #
VkCalibratedTimestampInfoEXT - Structure specifying the input parameters of a calibrated timestamp query
Valid Usage (Implicit)
See Also
CalibratedTimestampInfoEXT | |
|
Instances
newtype TimeDomainEXT Source #
VkTimeDomainEXT - Supported time domains
Description
Note
An implementation supporting VK_EXT_calibrated_timestamps
will use the
same time domain for all its Queue
so that
timestamp values reported for TIME_DOMAIN_DEVICE_EXT
can be matched to
any timestamp captured through
cmdWriteTimestamp
or
cmdWriteTimestamp2KHR
.
struct timespec tv; clock_gettime(CLOCK_MONOTONIC, &tv); return tv.tv_nsec + tv.tv_sec*1000000000ull;
struct timespec tv; clock_gettime(CLOCK_MONOTONIC_RAW, &tv); return tv.tv_nsec + tv.tv_sec*1000000000ull;
LARGE_INTEGER counter; QueryPerformanceCounter(&counter); return counter.QuadPart;
See Also
CalibratedTimestampInfoEXT
,
getPhysicalDeviceCalibrateableTimeDomainsEXT
pattern TIME_DOMAIN_DEVICE_EXT :: TimeDomainEXT |
|
pattern TIME_DOMAIN_CLOCK_MONOTONIC_EXT :: TimeDomainEXT |
|
pattern TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT :: TimeDomainEXT |
|
pattern TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT :: TimeDomainEXT |
|
Instances
pattern EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION :: forall a. Integral a => a Source #
type EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME = "VK_EXT_calibrated_timestamps" Source #
pattern EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #