C Specification

To begin an indexed query, call:

// Provided by VK_EXT_transform_feedback
void vkCmdBeginQueryIndexedEXT(
    VkCommandBuffer                             commandBuffer,
    VkQueryPool                                 queryPool,
    uint32_t                                    query,
    VkQueryControlFlags                         flags,
    uint32_t                                    index);

Parameters

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

  • queryPool is the query pool that will manage the results of the query.

  • query is the query index within the query pool that will contain the results.

  • flags is a bitmask of VkQueryControlFlagBits specifying constraints on the types of queries that can be performed.

  • index is the query type specific index. When the query type is VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT or VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT, the index represents the vertex stream.

Description

The vkCmdBeginQueryIndexedEXT command operates the same as the vkCmdBeginQuery command, except that it also accepts a query type specific index parameter.

This command defines an execution dependency between other query commands that reference the same query index.

The first synchronization scope includes all commands which reference the queries in queryPool indicated by query and index that occur earlier in submission order.

The second synchronization scope includes all commands which reference the queries in queryPool indicated by query and index that occur later in submission order.

The operation of this command happens after the first scope and happens before the second scope.

Valid Usage
Valid Usage (Implicit)
  • VUID-vkCmdBeginQueryIndexedEXT-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

  • VUID-vkCmdBeginQueryIndexedEXT-queryPool-parameter
    queryPool must be a valid VkQueryPool handle

  • VUID-vkCmdBeginQueryIndexedEXT-flags-parameter
    flags must be a valid combination of VkQueryControlFlagBits values

  • VUID-vkCmdBeginQueryIndexedEXT-commandBuffer-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdBeginQueryIndexedEXT-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_COMPUTE_BIT, VK_QUEUE_GRAPHICS_BIT, VK_QUEUE_VIDEO_DECODE_BIT_KHR, or VK_QUEUE_VIDEO_ENCODE_BIT_KHR operations

  • VUID-vkCmdBeginQueryIndexedEXT-suspended
    This command must not be called between suspended render pass instances

  • VUID-vkCmdBeginQueryIndexedEXT-videocoding
    This command must only be called outside of a video coding scope

  • VUID-vkCmdBeginQueryIndexedEXT-commonparent
    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

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type

Primary
Secondary

Both

Outside

VK_QUEUE_COMPUTE_BIT
VK_QUEUE_GRAPHICS_BIT
VK_QUEUE_VIDEO_DECODE_BIT_KHR
VK_QUEUE_VIDEO_ENCODE_BIT_KHR

Action
State

Conditional Rendering

vkCmdBeginQueryIndexedEXT is not affected by conditional rendering

See Also

Document Notes

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.

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0