// Copyright 2019-2023 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

// Common Valid Usage
// Common to vkCmdBeginQuery* commands
  * [[VUID-{refpage}-None-00807]]
    All queries used by the command must: be _unavailable_
  * [[VUID-{refpage}-queryType-02804]]
    The pname:queryType used to create pname:queryPool must: not be
    ename:VK_QUERY_TYPE_TIMESTAMP
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-{refpage}-queryType-04728]]
    The pname:queryType used to create pname:queryPool must: not be
    ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR or
    ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR
endif::VK_KHR_acceleration_structure[]
ifdef::VK_KHR_ray_tracing_maintenance1[]
  * [[VUID-{refpage}-queryType-06741]]
    The pname:queryType used to create pname:queryPool must: not be
    ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR or
    ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR
endif::VK_KHR_ray_tracing_maintenance1[]
ifdef::VK_NV_ray_tracing[]
  * [[VUID-{refpage}-queryType-04729]]
    The pname:queryType used to create pname:queryPool must: not be
    ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV
endif::VK_NV_ray_tracing[]
ifdef::VK_KHR_VK_EXT_opacity_micromap[]
  * [[VUID-{refpage}-queryType-08972]]
    The pname:queryType used to create pname:queryPool must: not be
    ename:VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT or
    ename:VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT
endif::VK_KHR_VK_EXT_opacity_micromap[]
  * [[VUID-{refpage}-queryType-00800]]
    If the <<features-occlusionQueryPrecise, pname:occlusionQueryPrecise>>
    feature is not enabled, or the pname:queryType used to create
    pname:queryPool was not ename:VK_QUERY_TYPE_OCCLUSION, pname:flags must:
    not contain ename:VK_QUERY_CONTROL_PRECISE_BIT
  * [[VUID-{refpage}-query-00802]]
    pname:query must: be less than the number of queries in pname:queryPool
  * [[VUID-{refpage}-queryType-00803]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_OCCLUSION, the sname:VkCommandPool that
    pname:commandBuffer was allocated from must: support graphics operations
  * [[VUID-{refpage}-queryType-00804]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the
    pname:pipelineStatistics indicate graphics operations, the
    sname:VkCommandPool that pname:commandBuffer was allocated from must:
    support graphics operations
  * [[VUID-{refpage}-queryType-00805]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the
    pname:pipelineStatistics indicate compute operations, the
    sname:VkCommandPool that pname:commandBuffer was allocated from must:
    support compute operations
ifdef::VK_VERSION_1_1[]
  * [[VUID-{refpage}-commandBuffer-01885]]
    pname:commandBuffer must: not be a protected command buffer
endif::VK_VERSION_1_1[]
ifdef::VK_VERSION_1_1,VK_KHR_multiview[]
  * [[VUID-{refpage}-query-00808]]
    If called within a render pass instance, the sum of pname: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 pname:queryPool
endif::VK_VERSION_1_1,VK_KHR_multiview[]
ifdef::VK_KHR_video_queue[]
  * [[VUID-{refpage}-queryType-07126]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, then the sname:VkCommandPool
    that pname:commandBuffer was allocated from must: have been created with
    a queue family index that supports <<queries-result-status-only,result
    status queries>>, as indicated by
    slink:VkQueueFamilyQueryResultStatusPropertiesKHR::pname:queryResultStatusSupport
  * [[VUID-{refpage}-None-07127]]
    If there is a bound video session, then there must: be no
    <<queries-operation-active,active>> queries
  * [[VUID-{refpage}-queryType-07128]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR and there is a bound video
    session, then pname:queryPool must: have been created with a
    slink:VkVideoProfileInfoKHR structure included in the pname:pNext chain
    of slink:VkQueryPoolCreateInfo identical to the one specified in
    slink:VkVideoSessionCreateInfoKHR::pname:pVideoProfile the bound video
    session was created with
endif::VK_KHR_video_queue[]
ifdef::VK_KHR_video_encode_queue[]
  * [[VUID-{refpage}-queryType-04862]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, then the
    sname:VkCommandPool that pname:commandBuffer was allocated from must:
    support <<video-encode-operations, video encode operations>>
  * [[VUID-{refpage}-queryType-07129]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, then there must: be a
    bound video session
  * [[VUID-{refpage}-queryType-07130]]
    If the pname:queryType used to create pname:queryPool was
    ename:VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR and there is a bound video
    session, then pname:queryPool must: have been created with a
    slink:VkVideoProfileInfoKHR structure included in the pname:pNext chain
    of slink:VkQueryPoolCreateInfo identical to the one specified in
    slink:VkVideoSessionCreateInfoKHR::pname:pVideoProfile the bound video
    session was created with
endif::VK_KHR_video_encode_queue[]
ifdef::VK_KHR_video_queue[]
ifdef::VK_KHR_video_encode_queue[]
  * [[VUID-{refpage}-queryType-07131]]
    If the pname:queryType used to create pname:queryPool was not
    ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR or
    ename:VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, then there must: be no
    bound video session
endif::VK_KHR_video_encode_queue[]
ifndef::VK_KHR_video_encode_queue[]
  * [[VUID-{refpage}-queryType-07132]]
    If the pname:queryType used to create pname:queryPool was not
    ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, then there must: be no bound
    video session
endif::VK_KHR_video_encode_queue[]
endif::VK_KHR_video_queue[]
// Common Valid Usage
