In order to be able to correlate the time a particular operation took place at on timelines of different time domains (e.g. a device operation vs. a host operation), Vulkan allows querying calibrated timestamps from multiple time domains.
To query calibrated timestamps from a set of time domains, call:
// Provided by VK_KHR_calibrated_timestamps VkResult vkGetCalibratedTimestampsKHR( VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation);
or the equivalent command
// Provided by VK_EXT_calibrated_timestamps VkResult vkGetCalibratedTimestampsEXT( VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation);
deviceis the logical device used to perform the query.
timestampCountis the number of timestamps to query.
pTimestampInfosis a pointer to an array of
timestampCountVkCalibratedTimestampInfoKHR structures, describing the time domains the calibrated timestamps should be captured from.
pTimestampsis a pointer to an array of
timestampCount64-bit unsigned integer values in which the requested calibrated timestamp values are returned.
pMaxDeviationis a pointer to a 64-bit unsigned integer value in which the strictly positive maximum deviation, in nanoseconds, of the calibrated timestamp values is returned.
The maximum deviation may vary between calls to
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.
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.