VKCMDWRITETIMESTAMP(3)

NAME
vkCmdWriteTimestamp - Write a device timestamp into a query object

C SPECIFICATION

To request a timestamp, call:

    void vkCmdWriteTimestamp(
        VkCommandBuffer                             commandBuffer,
        VkPipelineStageFlagBits                     pipelineStage,
        VkQueryPool                                 queryPool,
        uint32_t                                    query);

PARAMETERS

    • commandBuffer is the command buffer into which the command will be recorded.

    • pipelineStage is one of the VkPipelineStageFlagBits, specifying a stage of the pipeline.

    • queryPool is the query pool that will manage the timestamp.

    • query is the query within the query pool that will contain the timestamp.

DESCRIPTION

vkCmdWriteTimestamp latches the value of the timer when all previous commands have completed executing as far as the specified pipeline stage, and writes the timestamp value to memory. When the timestamp value is written, the availability status of the query is set to available.

    Note

    If an implementation is unable to detect completion and latch the timer at any specific stage of the pipeline, it may instead do so at any logically later stage.

vkCmdCopyQueryPoolResults can then be called to copy the timestamp value from the query pool into buffer memory, with ordering and synchronization behavior equivalent to how other queries operate. Timestamp values can also be retrieved from the query pool using vkGetQueryPoolResults. As with other queries, the query must be reset using vkCmdResetQueryPool before requesting the timestamp value be written to it.

While vkCmdWriteTimestamp can be called inside or outside of a render pass instance, vkCmdCopyQueryPoolResults must only be called outside of a render pass instance. Valid Usage

    • The query identified by queryPool and query must be unavailable

    • The command pool’s queue family must support a non-zero timestampValidBits
Valid Usage (Implicit)

    • commandBuffer must be a valid VkCommandBuffer handle

    • pipelineStage must be a valid VkPipelineStageFlagBits value

    • queryPool must be a valid VkQueryPool handle

    • commandBuffer must be in the recording state

    • The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations

    • Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice
Host Synchronization

    • Host access to commandBuffer must be externally synchronized
Command Properties
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Both | GRAPHICS COMPUTE

SEE ALSO

VkCommandBuffer, VkPipelineStageFlagBits, VkQueryPool

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdWriteTimestamp

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.