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

// Common Valid Usage
// Common to drawing commands that consume vertex binding state
  * [[VUID-{refpage}-None-04007]]
    All vertex input bindings accessed via vertex input variables declared
    in the vertex shader entry point's interface must: have either valid or
    dlink:VK_NULL_HANDLE buffers bound
  * [[VUID-{refpage}-None-04008]]
    If the <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, all vertex input bindings accessed via vertex input variables
    declared in the vertex shader entry point's interface must: not be
    dlink:VK_NULL_HANDLE
  * [[VUID-{refpage}-None-02721]]
    For a given vertex buffer binding, any attribute data fetched must: be
    entirely contained within the corresponding vertex buffer binding, as
    described in <<fxvertex-input>>
ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
  * [[VUID-{refpage}-None-07842]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    then flink:vkCmdSetPrimitiveTopology must: have been called in the
    current command buffer prior to this drawing command
ifndef::VK_EXT_extended_dynamic_state3[]
  * [[VUID-{refpage}-primitiveTopology-03420]]
    If the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state enabled then the
    pname:primitiveTopology parameter of fname:vkCmdSetPrimitiveTopology
    must: be of the same <<drawing-primitive-topology-class, topology
    class>> as the pipeline
    slink:VkPipelineInputAssemblyStateCreateInfo::pname:topology state
endif::VK_EXT_extended_dynamic_state3[]
ifdef::VK_EXT_extended_dynamic_state3[]
  * [[VUID-{refpage}-dynamicPrimitiveTopologyUnrestricted-07500]]
    If the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state enabled and the
    <<limits-dynamicPrimitiveTopologyUnrestricted,
    pname:dynamicPrimitiveTopologyUnrestricted>> is ename:VK_FALSE, then the
    pname:primitiveTopology parameter of fname:vkCmdSetPrimitiveTopology
    must: be of the same <<drawing-primitive-topology-class, topology
    class>> as the pipeline
    slink:VkPipelineInputAssemblyStateCreateInfo::pname:topology state
endif::VK_EXT_extended_dynamic_state3[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
  * [[VUID-{refpage}-None-04912]]
    If the bound graphics pipeline was created with both the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT and
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT dynamic states
    enabled, then flink:vkCmdSetVertexInputEXT must: have been called in the
    current command buffer prior to this draw command
  * [[VUID-{refpage}-pStrides-04913]]
    If the bound graphics pipeline was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT dynamic state
    enabled, but not the ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic
    state enabled, then flink:vkCmdBindVertexBuffers2EXT must: have been
    called in the current command buffer prior to this draw command, and the
    pname:pStrides parameter of flink:vkCmdBindVertexBuffers2EXT must: not
    be `NULL`
endif::VK_EXT_vertex_input_dynamic_state[]
ifndef::VK_EXT_vertex_input_dynamic_state[]
  * [[VUID-{refpage}-pStrides-04884]]
    If the bound graphics pipeline was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT dynamic state
    enabled, then flink:vkCmdBindVertexBuffers2EXT must: have been called in
    the current command buffer prior to this drawing command, and the
    pname:pStrides parameter of flink:vkCmdBindVertexBuffers2EXT must: not
    be `NULL`
endif::VK_EXT_vertex_input_dynamic_state[]
endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
ifdef::VK_EXT_vertex_input_dynamic_state,VK_EXT_shader_object[]
  * [[VUID-{refpage}-None-04914]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    then flink:vkCmdSetVertexInputEXT must: have been called in the current
    command buffer prior to this draw command
  * [[VUID-{refpage}-Input-07939]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    then all variables with the code:Input storage class decorated with
    code:Location in the code:Vertex {ExecutionModel} code:OpEntryPoint
    must: contain a location in
    slink:VkVertexInputAttributeDescription2EXT::pname:location
  * [[VUID-{refpage}-Input-08734]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    then the numeric type associated with all code:Input variables of the
    corresponding code:Location in the code:Vertex {ExecutionModel}
    code:OpEntryPoint must: be the same as
    slink:VkVertexInputAttributeDescription2EXT::pname:format
  * [[VUID-{refpage}-format-08936]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    and slink:VkVertexInputAttributeDescription2EXT::pname:format has a
    64-bit component, then the scalar width associated with all code:Input
    variables of the corresponding code:Location in the code:Vertex
    {ExecutionModel} code:OpEntryPoint must: be 64-bit
  * [[VUID-{refpage}-format-08937]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    and the scalar width associated with a code:Location decorated
    code:Input variable in the code:Vertex {ExecutionModel}
    code:OpEntryPoint is 64-bit, then the corresponding
    slink:VkVertexInputAttributeDescription2EXT::pname:format must: have a
    64-bit component
  * [[VUID-{refpage}-None-09203]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_vertex_input_dynamic_state[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_vertex_input_dynamic_state[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
    and slink:VkVertexInputAttributeDescription2EXT::pname:format has a
    64-bit component, then all code:Input variables at the corresponding
    code:Location in the code:Vertex {ExecutionModel} code:OpEntryPoint
    must: not use components that are not present in the format
endif::VK_EXT_vertex_input_dynamic_state,VK_EXT_shader_object[]
ifdef::VK_EXT_extended_dynamic_state2[]
  * [[VUID-{refpage}-None-04875]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage and the most recent call to fname:vkCmdSetPrimitiveTopology in the
    current command buffer set pname:primitiveTopology to
    ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST,
ifdef::VK_EXT_extended_dynamic_state2[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_extended_dynamic_state2[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT dynamic state enabled
endif::VK_EXT_extended_dynamic_state2[]
    then flink:vkCmdSetPatchControlPointsEXT must: have been called in the
    current command buffer prior to this drawing command
endif::VK_EXT_extended_dynamic_state2[]
ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2,VK_EXT_shader_object[]
  * [[VUID-{refpage}-None-04879]]
    If
ifdef::VK_EXT_shader_object[]
    there is a shader object bound to the ename:VK_SHADER_STAGE_VERTEX_BIT
    stage
ifdef::VK_EXT_extended_dynamic_state2[or]
endif::VK_EXT_shader_object[]
ifdef::VK_EXT_extended_dynamic_state2[]
    the bound graphics pipeline state was created with the
    ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE dynamic state enabled
endif::VK_EXT_extended_dynamic_state2[]
    then flink:vkCmdSetPrimitiveRestartEnable must: have been called in the
    current command buffer prior to this drawing command
endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2,VK_EXT_shader_object[]
ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
  * [[VUID-{refpage}-stage-06481]]
    The bound graphics pipeline must: not have been created with the
    slink:VkPipelineShaderStageCreateInfo::pname:stage member of an element
    of slink:VkGraphicsPipelineCreateInfo::pname:pStages set to
    ename:VK_SHADER_STAGE_TASK_BIT_EXT or ename:VK_SHADER_STAGE_MESH_BIT_EXT
ifdef::VK_EXT_shader_object[]
  * [[VUID-{refpage}-None-08885]]
    There must: be no shader object bound to either of the
    ename:VK_SHADER_STAGE_TASK_BIT_EXT or ename:VK_SHADER_STAGE_MESH_BIT_EXT
    stages
endif::VK_EXT_shader_object[]
endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
// Common Valid Usage
