vkCmdBeginQueryIndexedEXT(3)

# vkCmdBeginQueryIndexedEXT(3) Manual Page

## Name

vkCmdBeginQueryIndexedEXT - Begin an indexed query

Loading… please wait.

## 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.

Valid Usage

- VUID-vkCmdBeginQueryIndexedEXT-None-00807
  All queries used by the command must be unavailable

- VUID-vkCmdBeginQueryIndexedEXT-queryType-02804
  The `queryType` used to create `queryPool` must not be `VK_QUERY_TYPE_TIMESTAMP`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-04728
  The `queryType` used to create `queryPool` must not be `VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR` or `VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-06741
  The `queryType` used to create `queryPool` must not be `VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR` or `VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-04729
  The `queryType` used to create `queryPool` must not be `VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-00800
  If the precise occlusion queries feature is not enabled, or the `queryType` used to create `queryPool` was not `VK_QUERY_TYPE_OCCLUSION`, `flags` must not contain `VK_QUERY_CONTROL_PRECISE_BIT`

- VUID-vkCmdBeginQueryIndexedEXT-query-00802
  `query` must be less than the number of queries in `queryPool`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-00803
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_OCCLUSION`, the `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdBeginQueryIndexedEXT-queryType-00804
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_PIPELINE_STATISTICS` and any of the `pipelineStatistics` indicate graphics operations, the `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdBeginQueryIndexedEXT-queryType-00805
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_PIPELINE_STATISTICS` and any of the `pipelineStatistics` indicate compute operations, the `VkCommandPool` that `commandBuffer` was allocated from must support compute operations

- VUID-vkCmdBeginQueryIndexedEXT-commandBuffer-01885
  `commandBuffer` must not be a protected command buffer

- VUID-vkCmdBeginQueryIndexedEXT-query-00808
  If called within a render pass instance, the sum of `query` and the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries in `queryPool`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-04862
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR` the `VkCommandPool` that `commandBuffer` was allocated from must support video encode operations

- VUID-vkCmdBeginQueryIndexedEXT-queryPool-04753
  If the `queryPool` was created with the same `queryType` as that of another active query within `commandBuffer`, then `index` must not match the index used for the active query

- VUID-vkCmdBeginQueryIndexedEXT-queryType-02338
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT` the `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdBeginQueryIndexedEXT-queryType-02339
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT` the `index` parameter must be less than `VkPhysicalDeviceTransformFeedbackPropertiesEXT`::`maxTransformFeedbackStreams`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-06689
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT` the `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdBeginQueryIndexedEXT-queryType-06690
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT` the `index` parameter must be less than `VkPhysicalDeviceTransformFeedbackPropertiesEXT`::`maxTransformFeedbackStreams`

- VUID-vkCmdBeginQueryIndexedEXT-queryType-06691
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT` and the `primitivesGeneratedQueryWithNonZeroStreams` feature is not enabled, the `index` parameter must be zero.

- VUID-vkCmdBeginQueryIndexedEXT-queryType-06692
  If the `queryType` used to create `queryPool` was not `VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT` and not `VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT`, the `index` must be zero

- VUID-vkCmdBeginQueryIndexedEXT-queryType-06693
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT` then `primitivesGeneratedQuery` must be enabled

- VUID-vkCmdBeginQueryIndexedEXT-queryType-02341
  If the `queryType` used to create `queryPool` was `VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT` then `VkPhysicalDeviceTransformFeedbackPropertiesEXT`::`transformFeedbackQueries` must be supported

- VUID-vkCmdBeginQueryIndexedEXT-queryPool-03223
  If `queryPool` was created with a `queryType` of `VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR`, the profiling lock must have been held before vkBeginCommandBuffer was called on `commandBuffer`

- VUID-vkCmdBeginQueryIndexedEXT-queryPool-03224
  If `queryPool` was created with a `queryType` of `VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR` and one of the counters used to create `queryPool` was `VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR`, the query begin must be the first recorded command in `commandBuffer`

- VUID-vkCmdBeginQueryIndexedEXT-queryPool-03225
  If `queryPool` was created with a `queryType` of `VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR` and one of the counters used to create `queryPool` was `VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR`, the begin command must not be recorded within a render pass instance

- VUID-vkCmdBeginQueryIndexedEXT-queryPool-03226
  If `queryPool` was created with a `queryType` of `VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR` and another query pool with a `queryType` `VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR` has been used within `commandBuffer`, its parent primary command buffer or secondary command buffer recorded within the same parent primary command buffer as `commandBuffer`, the `performanceCounterMultipleQueryPools` feature must be enabled

- VUID-vkCmdBeginQueryIndexedEXT-None-02863
  If `queryPool` was created with a `queryType` of `VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR`, this command must not be recorded in a command buffer that, either directly or through secondary command buffers, also contains a `vkCmdResetQueryPool` command affecting the same query

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 graphics, or compute operations

- 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 | Supported Queue Types
--- | --- | ---
Primary Secondary | Both | Graphics Compute

## See Also

VK_EXT_transform_feedback, VkCommandBuffer, VkQueryControlFlags, VkQueryPool

## 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

Copyright 2014-2022 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0