VKCMDWRITETIMESTAMP(3)

NAME
vkCmdWriteTimestamp - Write a device timestamp into a query object.

C SPECIFICATION

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

PARAMETERS

commandBuffer
    The command buffer into which the command will be placed.

pipelineStage
    The stage of the pipeline at which the timestamp will be written.

queryPool
    A handle to the query pool object containing the query.

entry
    The entry in the query pool at which to write the query.

DESCRIPTION

vkCmdWriteTimestamp places a command into the command buffer specified by commandBuffer which, when executed, will cause the GPU to write its internal timestamp into the query pool specified by queryPool at the entry specified in entry. The timestamp is written when the command passes the pipeline stage specified by pipelineStage. The pipeline stage is a single member of the VkPipelineStageFlagBits enumeration, the definition of which is:

    typedef enum VkPipelineStageFlagBits {
        VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001,
        VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002,
        VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004,
        VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008,
        VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010,
        VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020,
        VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040,
        VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080,
        VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100,
        VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200,
        VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400,
        VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800,
        VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000,
        VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
        VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
        VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
        VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000,
    } VkPipelineStageFlagBits;

If an implementation is not capable of writing a timestamp value at the pipeline point specified, it may at its option write the timestamp at any point appearing later in the logical pipeline. However, it must do this consistently for similar pipeline configurations.

VALID USAGE

    • 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

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

    • The query identified by queryPool and query must be unavailable

    • The command pool’s queue family must support a non-zero timestampValidBits

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

vkCmdSetEvent

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.