1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group, Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[drawing]] 6e5c31af7Sopenharmony_ci= Drawing Commands 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ci_Drawing commands_ (commands with ftext:Draw in the name) provoke work in a 9e5c31af7Sopenharmony_cigraphics pipeline. 10e5c31af7Sopenharmony_ciDrawing commands are recorded into a command buffer and when executed by a 11e5c31af7Sopenharmony_ciqueue, will produce work which executes according to the bound graphics 12e5c31af7Sopenharmony_cipipeline. 13e5c31af7Sopenharmony_ciA graphics pipeline must: be bound to a command buffer before any drawing 14e5c31af7Sopenharmony_cicommands are recorded in that command buffer. 15e5c31af7Sopenharmony_ci 16e5c31af7Sopenharmony_ci[open,refpage='VkPipelineInputAssemblyStateCreateInfo',desc='Structure specifying parameters of a newly created pipeline input assembly state',type='structs'] 17e5c31af7Sopenharmony_ci-- 18e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 19e5c31af7Sopenharmony_ciDrawing can be achieved in two modes: 20e5c31af7Sopenharmony_ci 21e5c31af7Sopenharmony_ci * <<drawing-mesh-shading,Programmable Mesh Shading>>, the mesh shader 22e5c31af7Sopenharmony_ci assembles primitives, or 23e5c31af7Sopenharmony_ci * <<drawing-primitive-shading,Programmable Primitive Shading>>, the input 24e5c31af7Sopenharmony_ci primitives are assembled 25e5c31af7Sopenharmony_ci 26e5c31af7Sopenharmony_cias follows. 27e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 28e5c31af7Sopenharmony_ci 29e5c31af7Sopenharmony_ciEach draw is made up of zero or more vertices and zero or more instances, 30e5c31af7Sopenharmony_ciwhich are processed by the device and result in the assembly of primitives. 31e5c31af7Sopenharmony_ciPrimitives are assembled according to the pname:pInputAssemblyState member 32e5c31af7Sopenharmony_ciof the slink:VkGraphicsPipelineCreateInfo structure, which is of type 33e5c31af7Sopenharmony_cisname:VkPipelineInputAssemblyStateCreateInfo: 34e5c31af7Sopenharmony_ci 35e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineInputAssemblyStateCreateInfo.txt[] 36e5c31af7Sopenharmony_ci 37e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 38e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 39e5c31af7Sopenharmony_ci structure. 40e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 41e5c31af7Sopenharmony_ci * pname:topology is a elink:VkPrimitiveTopology defining the primitive 42e5c31af7Sopenharmony_ci topology, as described below. 43e5c31af7Sopenharmony_ci * pname:primitiveRestartEnable controls whether a special vertex index 44e5c31af7Sopenharmony_ci value is treated as restarting the assembly of primitives. 45e5c31af7Sopenharmony_ci This enable only applies to indexed draws (flink:vkCmdDrawIndexed, 46e5c31af7Sopenharmony_ciifdef::VK_EXT_multi_draw[] 47e5c31af7Sopenharmony_ci flink:vkCmdDrawMultiIndexedEXT, 48e5c31af7Sopenharmony_ciendif::VK_EXT_multi_draw[] 49e5c31af7Sopenharmony_ci and flink:vkCmdDrawIndexedIndirect), and the special index value is 50e5c31af7Sopenharmony_ci either 0xFFFFFFFF when the pname:indexType parameter of 51e5c31af7Sopenharmony_ci fname:vkCmdBindIndexBuffer is equal to ename:VK_INDEX_TYPE_UINT32, 52e5c31af7Sopenharmony_ciifdef::VK_EXT_index_type_uint8[] 53e5c31af7Sopenharmony_ci 0xFF when pname:indexType is equal to ename:VK_INDEX_TYPE_UINT8_EXT, 54e5c31af7Sopenharmony_ciendif::VK_EXT_index_type_uint8[] 55e5c31af7Sopenharmony_ci or 0xFFFF when pname:indexType is equal to ename:VK_INDEX_TYPE_UINT16. 56e5c31af7Sopenharmony_ciifndef::VK_EXT_primitive_topology_list_restart[] 57e5c31af7Sopenharmony_ci Primitive restart is not allowed for "`list`" topologies. 58e5c31af7Sopenharmony_ciendif::VK_EXT_primitive_topology_list_restart[] 59e5c31af7Sopenharmony_ciifdef::VK_EXT_primitive_topology_list_restart[] 60e5c31af7Sopenharmony_ci Primitive restart is not allowed for "`list`" topologies, unless one of 61e5c31af7Sopenharmony_ci the features 62e5c31af7Sopenharmony_ci <<features-primitiveTopologyPatchListRestart,pname:primitiveTopologyPatchListRestart>> 63e5c31af7Sopenharmony_ci (for ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) or 64e5c31af7Sopenharmony_ci <<features-primitiveTopologyListRestart,pname:primitiveTopologyListRestart>> 65e5c31af7Sopenharmony_ci (for all other list topologies) is enabled. 66e5c31af7Sopenharmony_ciendif::VK_EXT_primitive_topology_list_restart[] 67e5c31af7Sopenharmony_ci 68e5c31af7Sopenharmony_ciRestarting the assembly of primitives discards the most recent index values 69e5c31af7Sopenharmony_ciif those elements formed an incomplete primitive, and restarts the primitive 70e5c31af7Sopenharmony_ciassembly using the subsequent indices, but only assembling the immediately 71e5c31af7Sopenharmony_cifollowing element through the end of the originally specified elements. 72e5c31af7Sopenharmony_ciThe primitive restart index value comparison is performed before adding the 73e5c31af7Sopenharmony_cipname:vertexOffset value to the index value. 74e5c31af7Sopenharmony_ci 75e5c31af7Sopenharmony_ci.Valid Usage 76e5c31af7Sopenharmony_ci**** 77e5c31af7Sopenharmony_ciifndef::VK_EXT_primitive_topology_list_restart[] 78e5c31af7Sopenharmony_ci * [[VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00428]] 79e5c31af7Sopenharmony_ci If pname:topology is ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 80e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST, 81e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 82e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, 83e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY or 84e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, pname:primitiveRestartEnable 85e5c31af7Sopenharmony_ci must: be ename:VK_FALSE 86e5c31af7Sopenharmony_ciendif::VK_EXT_primitive_topology_list_restart[] 87e5c31af7Sopenharmony_ciifdef::VK_EXT_primitive_topology_list_restart[] 88e5c31af7Sopenharmony_ci * [[VUID-VkPipelineInputAssemblyStateCreateInfo-topology-06252]] 89e5c31af7Sopenharmony_ci If pname:topology is ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 90e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST, 91e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 92e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY or 93e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY, and 94e5c31af7Sopenharmony_ci pname:primitiveRestartEnable is ename:VK_TRUE, the 95e5c31af7Sopenharmony_ci <<features-primitiveTopologyListRestart,pname:primitiveTopologyListRestart>> 96e5c31af7Sopenharmony_ci feature must: be enabled 97e5c31af7Sopenharmony_ci * [[VUID-VkPipelineInputAssemblyStateCreateInfo-topology-06253]] 98e5c31af7Sopenharmony_ci If pname:topology is ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, and 99e5c31af7Sopenharmony_ci pname:primitiveRestartEnable is ename:VK_TRUE, the 100e5c31af7Sopenharmony_ci <<features-primitiveTopologyPatchListRestart,pname:primitiveTopologyPatchListRestart>> 101e5c31af7Sopenharmony_ci feature must: be enabled 102e5c31af7Sopenharmony_ciendif::VK_EXT_primitive_topology_list_restart[] 103e5c31af7Sopenharmony_ci * [[VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00429]] 104e5c31af7Sopenharmony_ci If the <<features-geometryShader,geometry shaders>> feature is not 105e5c31af7Sopenharmony_ci enabled, pname:topology must: not be any of 106e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, 107e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY, 108e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY or 109e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY 110e5c31af7Sopenharmony_ci * [[VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00430]] 111e5c31af7Sopenharmony_ci If the <<features-tessellationShader,tessellation shaders>> feature is 112e5c31af7Sopenharmony_ci not enabled, pname:topology must: not be 113e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST 114e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[] 115e5c31af7Sopenharmony_ci * [[VUID-VkPipelineInputAssemblyStateCreateInfo-triangleFans-04452]] 116e5c31af7Sopenharmony_ci If the `apiext:VK_KHR_portability_subset` extension is enabled, and 117e5c31af7Sopenharmony_ci slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:triangleFans 118e5c31af7Sopenharmony_ci is ename:VK_FALSE, pname:topology must: not be 119e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN 120e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[] 121e5c31af7Sopenharmony_ci**** 122e5c31af7Sopenharmony_ci 123e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineInputAssemblyStateCreateInfo.txt[] 124e5c31af7Sopenharmony_ci-- 125e5c31af7Sopenharmony_ci 126e5c31af7Sopenharmony_ci[open,refpage='VkPipelineInputAssemblyStateCreateFlags',desc='Reserved for future use',type='flags'] 127e5c31af7Sopenharmony_ci-- 128e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineInputAssemblyStateCreateFlags.txt[] 129e5c31af7Sopenharmony_ci 130e5c31af7Sopenharmony_citname:VkPipelineInputAssemblyStateCreateFlags is a bitmask type for setting 131e5c31af7Sopenharmony_cia mask, but is currently reserved for future use. 132e5c31af7Sopenharmony_ci-- 133e5c31af7Sopenharmony_ci 134e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state2[] 135e5c31af7Sopenharmony_ci[open,refpage='vkCmdSetPrimitiveRestartEnableEXT',desc='Set primitive assembly restart state dynamically for a command buffer',type='protos'] 136e5c31af7Sopenharmony_ci-- 137e5c31af7Sopenharmony_ciTo <<pipelines-dynamic-state, dynamically control>> whether a special vertex 138e5c31af7Sopenharmony_ciindex value is treated as restarting the assembly of primitives, call: 139e5c31af7Sopenharmony_ci 140e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdSetPrimitiveRestartEnableEXT.txt[] 141e5c31af7Sopenharmony_ci 142e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 143e5c31af7Sopenharmony_ci recorded. 144e5c31af7Sopenharmony_ci * pname:primitiveRestartEnable controls whether a special vertex index 145e5c31af7Sopenharmony_ci value is treated as restarting the assembly of primitives. 146e5c31af7Sopenharmony_ci It behaves in the same way as 147e5c31af7Sopenharmony_ci sname:VkPipelineInputAssemblyStateCreateInfo::pname:primitiveRestartEnable 148e5c31af7Sopenharmony_ci 149e5c31af7Sopenharmony_ciThis command sets the primitive restart enable for subsequent drawing 150e5c31af7Sopenharmony_cicommands when the graphics pipeline is created with 151e5c31af7Sopenharmony_ciename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT set in 152e5c31af7Sopenharmony_cislink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates. 153e5c31af7Sopenharmony_ciOtherwise, this state is specified by the 154e5c31af7Sopenharmony_cislink:VkPipelineInputAssemblyStateCreateInfo::pname:primitiveRestartEnable 155e5c31af7Sopenharmony_civalue used to create the currently active pipeline. 156e5c31af7Sopenharmony_ci 157e5c31af7Sopenharmony_ci.Valid Usage 158e5c31af7Sopenharmony_ci**** 159e5c31af7Sopenharmony_ci * [[VUID-vkCmdSetPrimitiveRestartEnableEXT-None-04866]] 160e5c31af7Sopenharmony_ci The <<features-extendedDynamicState2, extendedDynamicState2>> feature 161e5c31af7Sopenharmony_ci must: be enabled 162e5c31af7Sopenharmony_ci**** 163e5c31af7Sopenharmony_ci 164e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdSetPrimitiveRestartEnableEXT.txt[] 165e5c31af7Sopenharmony_ci-- 166e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state2[] 167e5c31af7Sopenharmony_ci 168e5c31af7Sopenharmony_ci 169e5c31af7Sopenharmony_ci[[drawing-primitive-topologies]] 170e5c31af7Sopenharmony_ci== Primitive Topologies 171e5c31af7Sopenharmony_ci 172e5c31af7Sopenharmony_ci_Primitive topology_ determines how consecutive vertices are organized into 173e5c31af7Sopenharmony_ciprimitives, and determines the type of primitive that is used at the 174e5c31af7Sopenharmony_cibeginning of the graphics pipeline. 175e5c31af7Sopenharmony_ciThe effective topology for later stages of the pipeline is altered by 176e5c31af7Sopenharmony_citessellation or geometry shading (if either is in use) and depends on the 177e5c31af7Sopenharmony_ciexecution modes of those shaders. 178e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 179e5c31af7Sopenharmony_ciIn the case of mesh shading the only effective topology is defined by the 180e5c31af7Sopenharmony_ciexecution mode of the mesh shader. 181e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 182e5c31af7Sopenharmony_ci 183e5c31af7Sopenharmony_ci[open,refpage='VkPrimitiveTopology',desc='Supported primitive topologies',type='enums'] 184e5c31af7Sopenharmony_ci-- 185e5c31af7Sopenharmony_ciThe primitive topologies defined by elink:VkPrimitiveTopology are: 186e5c31af7Sopenharmony_ci 187e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkPrimitiveTopology.txt[] 188e5c31af7Sopenharmony_ci 189e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST specifies a series of 190e5c31af7Sopenharmony_ci <<drawing-point-lists,separate point primitives>>. 191e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST specifies a series of 192e5c31af7Sopenharmony_ci <<drawing-line-lists,separate line primitives>>. 193e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP specifies a series of 194e5c31af7Sopenharmony_ci <<drawing-line-strips,connected line primitives>> with consecutive lines 195e5c31af7Sopenharmony_ci sharing a vertex. 196e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST specifies a series of 197e5c31af7Sopenharmony_ci <<drawing-triangle-lists,separate triangle primitives>>. 198e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP specifies a series of 199e5c31af7Sopenharmony_ci <<drawing-triangle-strips,connected triangle primitives>> with 200e5c31af7Sopenharmony_ci consecutive triangles sharing an edge. 201e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN specifies a series of 202e5c31af7Sopenharmony_ci <<drawing-triangle-fans,connected triangle primitives>> with all 203e5c31af7Sopenharmony_ci triangles sharing a common vertex. 204e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[] 205e5c31af7Sopenharmony_ci If the `apiext:VK_KHR_portability_subset` extension is enabled, and 206e5c31af7Sopenharmony_ci slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:triangleFans 207e5c31af7Sopenharmony_ci is ename:VK_FALSE, then triangle fans are not supported by the 208e5c31af7Sopenharmony_ci implementation, and ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN must: not 209e5c31af7Sopenharmony_ci be used. 210e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[] 211e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY specifies a series 212e5c31af7Sopenharmony_ci of <<drawing-line-lists-with-adjacency,separate line primitives with 213e5c31af7Sopenharmony_ci adjacency>>. 214e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY specifies a series 215e5c31af7Sopenharmony_ci of <<drawing-line-strips-with-adjacency,connected line primitives with 216e5c31af7Sopenharmony_ci adjacency>>, with consecutive primitives sharing three vertices. 217e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY specifies a 218e5c31af7Sopenharmony_ci series of <<drawing-triangle-lists-with-adjacency,separate triangle 219e5c31af7Sopenharmony_ci primitives with adjacency>>. 220e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY specifies 221e5c31af7Sopenharmony_ci <<drawing-triangle-strips-with-adjacency,connected triangle primitives 222e5c31af7Sopenharmony_ci with adjacency>>, with consecutive triangles sharing an edge. 223e5c31af7Sopenharmony_ci * ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST specifies 224e5c31af7Sopenharmony_ci <<drawing-patch-lists,separate patch primitives>>. 225e5c31af7Sopenharmony_ci 226e5c31af7Sopenharmony_ciEach primitive topology, and its construction from a list of vertices, is 227e5c31af7Sopenharmony_cidescribed in detail below with a supporting diagram, according to the 228e5c31af7Sopenharmony_cifollowing key: 229e5c31af7Sopenharmony_ci 230e5c31af7Sopenharmony_ci[cols="1,2,9"] 231e5c31af7Sopenharmony_ci|==== 232e5c31af7Sopenharmony_ci^.^| image:{images}/primitive_topology_key_vertex.svg[pdfwidth=6pt,align="center",opts="{imageopts}"] 233e5c31af7Sopenharmony_ci.^| Vertex 234e5c31af7Sopenharmony_ci| A point in 3-dimensional space. 235e5c31af7Sopenharmony_ci Positions chosen within the diagrams are arbitrary and for 236e5c31af7Sopenharmony_ci illustration only. 237e5c31af7Sopenharmony_ci 238e5c31af7Sopenharmony_ci^.^| image:{images}/primitive_topology_key_vertex_number.svg[pdfwidth=6pt,align="center",opts="{imageopts}"] 239e5c31af7Sopenharmony_ci.^| Vertex Number 240e5c31af7Sopenharmony_ci| Sequence position of a vertex within the provided vertex data. 241e5c31af7Sopenharmony_ci 242e5c31af7Sopenharmony_ci^.^| image:{images}/primitive_topology_key_provoking_vertex.svg[pdfwidth=30pt,align="center",opts="{imageopts}"] 243e5c31af7Sopenharmony_ci.^| Provoking Vertex 244e5c31af7Sopenharmony_ci| Provoking vertex within the main primitive. 245e5c31af7Sopenharmony_ci The tail is angled towards the relevant primitive. 246e5c31af7Sopenharmony_ci Used in <<vertexpostproc-flatshading, flat shading>>. 247e5c31af7Sopenharmony_ci 248e5c31af7Sopenharmony_ci^.^| image:{images}/primitive_topology_key_edge.svg[pdfwidth=30pt,align="center",opts="{imageopts}"] 249e5c31af7Sopenharmony_ci.^| Primitive Edge 250e5c31af7Sopenharmony_ci| An edge connecting the points of a main primitive. 251e5c31af7Sopenharmony_ci 252e5c31af7Sopenharmony_ci^.^| image:{images}/primitive_topology_key_adjacency_edge.svg[pdfwidth=30pt,align="center",opts="{imageopts}"] 253e5c31af7Sopenharmony_ci.^| Adjacency Edge 254e5c31af7Sopenharmony_ci| Points connected by these lines do not contribute to a main primitive, 255e5c31af7Sopenharmony_ci and are only accessible in a <<geometry,geometry shader>>. 256e5c31af7Sopenharmony_ci 257e5c31af7Sopenharmony_ci^.^| image:{images}/primitive_topology_key_winding_order.svg[pdfwidth=30pt,align="center",opts="{imageopts}"] 258e5c31af7Sopenharmony_ci.^| Winding Order 259e5c31af7Sopenharmony_ci| The relative order in which vertices are defined within a primitive, 260e5c31af7Sopenharmony_ci used in the <<primsrast-polygons-basic,facing determination>>. 261e5c31af7Sopenharmony_ci This ordering has no specific start or end point. 262e5c31af7Sopenharmony_ci|==== 263e5c31af7Sopenharmony_ci 264e5c31af7Sopenharmony_ciThe diagrams are supported with mathematical definitions where the vertices 265e5c31af7Sopenharmony_ci([eq]#v#) and primitives ([eq]#p#) are numbered starting from [eq]#0#; 266e5c31af7Sopenharmony_ci[eq]#v~0~# is the first vertex in the provided data and [eq]#p~0~# is the 267e5c31af7Sopenharmony_cifirst primitive in the set of primitives defined by the vertices and 268e5c31af7Sopenharmony_citopology. 269e5c31af7Sopenharmony_ci-- 270e5c31af7Sopenharmony_ci 271e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[] 272e5c31af7Sopenharmony_ci[open,refpage='vkCmdSetPrimitiveTopologyEXT',desc='Set primitive topology state dynamically for a command buffer',type='protos'] 273e5c31af7Sopenharmony_ci-- 274e5c31af7Sopenharmony_ciTo <<pipelines-dynamic-state, dynamically set>> primitive topology, call: 275e5c31af7Sopenharmony_ci 276e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdSetPrimitiveTopologyEXT.txt[] 277e5c31af7Sopenharmony_ci 278e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 279e5c31af7Sopenharmony_ci recorded. 280e5c31af7Sopenharmony_ci * pname:primitiveTopology specifies the primitive topology to use for 281e5c31af7Sopenharmony_ci drawing. 282e5c31af7Sopenharmony_ci 283e5c31af7Sopenharmony_ciThis command sets the primitive topology for subsequent drawing commands 284e5c31af7Sopenharmony_ciwhen the graphics pipeline is created with 285e5c31af7Sopenharmony_ciename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT set in 286e5c31af7Sopenharmony_cislink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates. 287e5c31af7Sopenharmony_ciOtherwise, this state is specified by the 288e5c31af7Sopenharmony_cislink:VkPipelineInputAssemblyStateCreateInfo::pname:topology value used to 289e5c31af7Sopenharmony_cicreate the currently active pipeline. 290e5c31af7Sopenharmony_ci 291e5c31af7Sopenharmony_ci.Valid Usage 292e5c31af7Sopenharmony_ci**** 293e5c31af7Sopenharmony_ci * [[VUID-vkCmdSetPrimitiveTopologyEXT-None-03347]] 294e5c31af7Sopenharmony_ci The <<features-extendedDynamicState, extendedDynamicState>> feature 295e5c31af7Sopenharmony_ci must: be enabled 296e5c31af7Sopenharmony_ci**** 297e5c31af7Sopenharmony_ci 298e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdSetPrimitiveTopologyEXT.txt[] 299e5c31af7Sopenharmony_ci-- 300e5c31af7Sopenharmony_ci 301e5c31af7Sopenharmony_ci 302e5c31af7Sopenharmony_ci[[drawing-primitive-topology-class]] 303e5c31af7Sopenharmony_ci=== Topology Class 304e5c31af7Sopenharmony_ci 305e5c31af7Sopenharmony_ciThe primitive topologies are grouped into the following topology classes: 306e5c31af7Sopenharmony_ci 307e5c31af7Sopenharmony_ci[[topology-classes]] 308e5c31af7Sopenharmony_ci.Topology classes 309e5c31af7Sopenharmony_ci[options="header"] 310e5c31af7Sopenharmony_ci|=== 311e5c31af7Sopenharmony_ci| Topology Class | Primitive Topology 312e5c31af7Sopenharmony_ci| Point | ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST 313e5c31af7Sopenharmony_ci| Line | ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST, 314e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, 315e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, 316e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY 317e5c31af7Sopenharmony_ci| Triangle | ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 318e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, 319e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN, 320e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY, 321e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY 322e5c31af7Sopenharmony_ci| Patch | ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST 323e5c31af7Sopenharmony_ci|=== 324e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[] 325e5c31af7Sopenharmony_ci 326e5c31af7Sopenharmony_ci 327e5c31af7Sopenharmony_ci[[drawing-point-lists]] 328e5c31af7Sopenharmony_ci=== Point Lists 329e5c31af7Sopenharmony_ci 330e5c31af7Sopenharmony_ciWhen the topology is ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST, each 331e5c31af7Sopenharmony_ciconsecutive vertex defines a single point primitive, according to the 332e5c31af7Sopenharmony_ciequation: 333e5c31af7Sopenharmony_ci 334e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~i~}# 335e5c31af7Sopenharmony_ci 336e5c31af7Sopenharmony_ciAs there is only one vertex, that vertex is the provoking vertex. 337e5c31af7Sopenharmony_ciThe number of primitives generated is equal to [eq]#pname:vertexCount#. 338e5c31af7Sopenharmony_ci 339e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_point_list.svg[align="center",opts="{imageopts}"] 340e5c31af7Sopenharmony_ci 341e5c31af7Sopenharmony_ci 342e5c31af7Sopenharmony_ci[[drawing-line-lists]] 343e5c31af7Sopenharmony_ci=== Line Lists 344e5c31af7Sopenharmony_ci 345e5c31af7Sopenharmony_ciWhen the primitive topology is ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST, each 346e5c31af7Sopenharmony_ciconsecutive pair of vertices defines a single line primitive, according to 347e5c31af7Sopenharmony_cithe equation: 348e5c31af7Sopenharmony_ci 349e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~2i~, v~2i+1~}# 350e5c31af7Sopenharmony_ci 351e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 352e5c31af7Sopenharmony_ci[eq]#{lfloor}pname:vertexCount/2{rfloor}#. 353e5c31af7Sopenharmony_ci 354e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 355e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 356e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 357e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 358e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 359e5c31af7Sopenharmony_ciThe 360e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 361e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~2i~#. 362e5c31af7Sopenharmony_ci 363e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_list.svg[align="center",opts="{imageopts}"] 364e5c31af7Sopenharmony_ci 365e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 366e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 367e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 368e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~2i+1~#. 369e5c31af7Sopenharmony_ci 370e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_list_last.svg[align="center",opts="{imageopts}"] 371e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 372e5c31af7Sopenharmony_ci 373e5c31af7Sopenharmony_ci 374e5c31af7Sopenharmony_ci[[drawing-line-strips]] 375e5c31af7Sopenharmony_ci=== Line Strips 376e5c31af7Sopenharmony_ci 377e5c31af7Sopenharmony_ciWhen the primitive topology is ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, one 378e5c31af7Sopenharmony_ciline primitive is defined by each vertex and the following vertex, according 379e5c31af7Sopenharmony_cito the equation: 380e5c31af7Sopenharmony_ci 381e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~i~, v~i+1~}# 382e5c31af7Sopenharmony_ci 383e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 384e5c31af7Sopenharmony_ci[eq]#max(0,pname:vertexCount-1)#. 385e5c31af7Sopenharmony_ci 386e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 387e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 388e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 389e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 390e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 391e5c31af7Sopenharmony_ciThe 392e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 393e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~i~#. 394e5c31af7Sopenharmony_ci 395e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_strip.svg[align="center",opts="{imageopts}"] 396e5c31af7Sopenharmony_ci 397e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 398e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 399e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 400e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~i+1~#. 401e5c31af7Sopenharmony_ci 402e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_strip_last.svg[align="center",opts="{imageopts}"] 403e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 404e5c31af7Sopenharmony_ci 405e5c31af7Sopenharmony_ci 406e5c31af7Sopenharmony_ci[[drawing-triangle-lists]] 407e5c31af7Sopenharmony_ci=== Triangle Lists 408e5c31af7Sopenharmony_ci 409e5c31af7Sopenharmony_ciWhen the primitive topology is ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 410e5c31af7Sopenharmony_cieach consecutive set of three vertices defines a single triangle primitive, 411e5c31af7Sopenharmony_ciaccording to the equation: 412e5c31af7Sopenharmony_ci 413e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~3i~, v~3i+1~, v~3i+2~}# 414e5c31af7Sopenharmony_ci 415e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 416e5c31af7Sopenharmony_ci[eq]#{lfloor}pname:vertexCount/3{rfloor}#. 417e5c31af7Sopenharmony_ci 418e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 419e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 420e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 421e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 422e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 423e5c31af7Sopenharmony_ciThe 424e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 425e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~3i~#. 426e5c31af7Sopenharmony_ci 427e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_list.svg[align="center",opts="{imageopts}"] 428e5c31af7Sopenharmony_ci 429e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 430e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 431e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 432e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~3i+2~#. 433e5c31af7Sopenharmony_ci 434e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_list_last.svg[align="center",opts="{imageopts}"] 435e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 436e5c31af7Sopenharmony_ci 437e5c31af7Sopenharmony_ci 438e5c31af7Sopenharmony_ci[[drawing-triangle-strips]] 439e5c31af7Sopenharmony_ci=== Triangle Strips 440e5c31af7Sopenharmony_ci 441e5c31af7Sopenharmony_ciWhen the primitive topology is ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, 442e5c31af7Sopenharmony_cione triangle primitive is defined by each vertex and the two vertices that 443e5c31af7Sopenharmony_cifollow it, according to the equation: 444e5c31af7Sopenharmony_ci 445e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~i~, v~i+(1+i%2)~, v~i+(2-i%2)~}# 446e5c31af7Sopenharmony_ci 447e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 448e5c31af7Sopenharmony_ci[eq]#max(0,pname:vertexCount-2)#. 449e5c31af7Sopenharmony_ci 450e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 451e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 452e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 453e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 454e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 455e5c31af7Sopenharmony_ciThe 456e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 457e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~i~#. 458e5c31af7Sopenharmony_ci 459e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_strip.svg[align="center",opts="{imageopts}"] 460e5c31af7Sopenharmony_ci 461e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 462e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 463e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 464e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~i+2~#. 465e5c31af7Sopenharmony_ci 466e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_strip_last.svg[align="center",opts="{imageopts}"] 467e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 468e5c31af7Sopenharmony_ci 469e5c31af7Sopenharmony_ci[NOTE] 470e5c31af7Sopenharmony_ci.Note 471e5c31af7Sopenharmony_ci==== 472e5c31af7Sopenharmony_ciThe ordering of the vertices in each successive triangle is reversed, so 473e5c31af7Sopenharmony_cithat the winding order is consistent throughout the strip. 474e5c31af7Sopenharmony_ci==== 475e5c31af7Sopenharmony_ci 476e5c31af7Sopenharmony_ci 477e5c31af7Sopenharmony_ci[[drawing-triangle-fans]] 478e5c31af7Sopenharmony_ci=== Triangle Fans 479e5c31af7Sopenharmony_ci 480e5c31af7Sopenharmony_ciWhen the primitive topology is ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN, 481e5c31af7Sopenharmony_citriangle primitives are defined around a shared common vertex, according to 482e5c31af7Sopenharmony_cithe equation: 483e5c31af7Sopenharmony_ci 484e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~i+1~, v~i+2~, v~0~}# 485e5c31af7Sopenharmony_ci 486e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 487e5c31af7Sopenharmony_ci[eq]#max(0,pname:vertexCount-2)#. 488e5c31af7Sopenharmony_ci 489e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 490e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 491e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 492e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 493e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 494e5c31af7Sopenharmony_ciThe 495e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 496e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~i+1~#. 497e5c31af7Sopenharmony_ci 498e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_fan.svg[align="center",opts="{imageopts}"] 499e5c31af7Sopenharmony_ci 500e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 501e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 502e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 503e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~i+2~#. 504e5c31af7Sopenharmony_ci 505e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_fan_last.svg[align="center",opts="{imageopts}"] 506e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 507e5c31af7Sopenharmony_ci 508e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[] 509e5c31af7Sopenharmony_ci[NOTE] 510e5c31af7Sopenharmony_ci.Note 511e5c31af7Sopenharmony_ci==== 512e5c31af7Sopenharmony_ciIf the `apiext:VK_KHR_portability_subset` extension is enabled, and 513e5c31af7Sopenharmony_cislink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:triangleFans is 514e5c31af7Sopenharmony_ciename:VK_FALSE, then triangle fans are not supported by the implementation, 515e5c31af7Sopenharmony_ciand ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN must: not be used. 516e5c31af7Sopenharmony_ci==== 517e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[] 518e5c31af7Sopenharmony_ci 519e5c31af7Sopenharmony_ci 520e5c31af7Sopenharmony_ci[[drawing-line-lists-with-adjacency]] 521e5c31af7Sopenharmony_ci=== Line Lists With Adjacency 522e5c31af7Sopenharmony_ci 523e5c31af7Sopenharmony_ciWhen the primitive topology is 524e5c31af7Sopenharmony_ciename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, each consecutive set 525e5c31af7Sopenharmony_ciof four vertices defines a single line primitive with adjacency, according 526e5c31af7Sopenharmony_cito the equation: 527e5c31af7Sopenharmony_ci 528e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~4i~, v~4i+1~, v~4i+2~,v~4i+3~}# 529e5c31af7Sopenharmony_ci 530e5c31af7Sopenharmony_ciA line primitive is described by the second and third vertices of the total 531e5c31af7Sopenharmony_ciprimitive, with the remaining two vertices only accessible in a 532e5c31af7Sopenharmony_ci<<geometry,geometry shader>>. 533e5c31af7Sopenharmony_ci 534e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 535e5c31af7Sopenharmony_ci[eq]#{lfloor}pname:vertexCount/4{rfloor}#. 536e5c31af7Sopenharmony_ci 537e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 538e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 539e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 540e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 541e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 542e5c31af7Sopenharmony_ciThe 543e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 544e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~4i+1~#. 545e5c31af7Sopenharmony_ci 546e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_list_with_adjacency.svg[align="center",opts="{imageopts}"] 547e5c31af7Sopenharmony_ci 548e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 549e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 550e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 551e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~4i+2~#. 552e5c31af7Sopenharmony_ci 553e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_list_with_adjacency_last.svg[align="center",opts="{imageopts}"] 554e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 555e5c31af7Sopenharmony_ci 556e5c31af7Sopenharmony_ci 557e5c31af7Sopenharmony_ci[[drawing-line-strips-with-adjacency]] 558e5c31af7Sopenharmony_ci=== Line Strips With Adjacency 559e5c31af7Sopenharmony_ci 560e5c31af7Sopenharmony_ciWhen the primitive topology is 561e5c31af7Sopenharmony_ciename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY, one line primitive 562e5c31af7Sopenharmony_ciwith adjacency is defined by each vertex and the following vertex, according 563e5c31af7Sopenharmony_cito the equation: 564e5c31af7Sopenharmony_ci 565e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~i~, v~i+1~, v~i+2~, v~i+3~}# 566e5c31af7Sopenharmony_ci 567e5c31af7Sopenharmony_ciA line primitive is described by the second and third vertices of the total 568e5c31af7Sopenharmony_ciprimitive, with the remaining two vertices only accessible in a 569e5c31af7Sopenharmony_ci<<geometry,geometry shader>>. 570e5c31af7Sopenharmony_ci 571e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 572e5c31af7Sopenharmony_ci[eq]#max(0,pname:vertexCount-3)#. 573e5c31af7Sopenharmony_ci 574e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 575e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 576e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 577e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 578e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 579e5c31af7Sopenharmony_ciThe 580e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 581e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~i+1~#. 582e5c31af7Sopenharmony_ci 583e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_strip_with_adjacency.svg[align="center",opts="{imageopts}"] 584e5c31af7Sopenharmony_ci 585e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 586e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 587e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 588e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~i+2~#. 589e5c31af7Sopenharmony_ci 590e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_line_strip_with_adjacency_last.svg[align="center",opts="{imageopts}"] 591e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 592e5c31af7Sopenharmony_ci 593e5c31af7Sopenharmony_ci 594e5c31af7Sopenharmony_ci[[drawing-triangle-lists-with-adjacency]] 595e5c31af7Sopenharmony_ci=== Triangle Lists With Adjacency 596e5c31af7Sopenharmony_ci 597e5c31af7Sopenharmony_ciWhen the primitive topology is 598e5c31af7Sopenharmony_ciename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY, each consecutive 599e5c31af7Sopenharmony_ciset of six vertices defines a single triangle primitive with adjacency, 600e5c31af7Sopenharmony_ciaccording to the equations: 601e5c31af7Sopenharmony_ci 602e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~6i~, v~6i+1~, v~6i+2~, v~6i+3~, v~6i+4~, 603e5c31af7Sopenharmony_ci v~6i+5~}# 604e5c31af7Sopenharmony_ci 605e5c31af7Sopenharmony_ciA triangle primitive is described by the first, third, and fifth vertices of 606e5c31af7Sopenharmony_cithe total primitive, with the remaining three vertices only accessible in a 607e5c31af7Sopenharmony_ci<<geometry,geometry shader>>. 608e5c31af7Sopenharmony_ci 609e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 610e5c31af7Sopenharmony_ci[eq]#{lfloor}pname:vertexCount/6{rfloor}#. 611e5c31af7Sopenharmony_ci 612e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 613e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 614e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 615e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 616e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 617e5c31af7Sopenharmony_ciThe 618e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 619e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is [eq]#v~6i~#. 620e5c31af7Sopenharmony_ci 621e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_list_with_adjacency.svg[align="center",opts="{imageopts}"] 622e5c31af7Sopenharmony_ci 623e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 624e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 625e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 626e5c31af7Sopenharmony_ci[eq]#p~i~# is [eq]#v~6i+4~#. 627e5c31af7Sopenharmony_ci 628e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_list_with_adjacency_last.svg[align="center",opts="{imageopts}"] 629e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 630e5c31af7Sopenharmony_ci 631e5c31af7Sopenharmony_ci 632e5c31af7Sopenharmony_ci[[drawing-triangle-strips-with-adjacency]] 633e5c31af7Sopenharmony_ci=== Triangle Strips With Adjacency 634e5c31af7Sopenharmony_ci 635e5c31af7Sopenharmony_ciWhen the primitive topology is 636e5c31af7Sopenharmony_ciename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY, one triangle 637e5c31af7Sopenharmony_ciprimitive with adjacency is defined by each vertex and the following 5 638e5c31af7Sopenharmony_civertices. 639e5c31af7Sopenharmony_ci 640e5c31af7Sopenharmony_ciThe number of primitives generated, [eq]#n#, is equal to [eq]#{lfloor}max(0, 641e5c31af7Sopenharmony_cipname:vertexCount - 4)/2{rfloor}#. 642e5c31af7Sopenharmony_ci 643e5c31af7Sopenharmony_ciIf [eq]#n=1#, the primitive is defined as: 644e5c31af7Sopenharmony_ci 645e5c31af7Sopenharmony_ci {empty}:: [eq]#p = {v~0~, v~1~, v~2~, v~5~, v~4~, v~3~}# 646e5c31af7Sopenharmony_ci 647e5c31af7Sopenharmony_ciIf [eq]#n>1#, the total primitive consists of different vertices according 648e5c31af7Sopenharmony_cito where it is in the strip: 649e5c31af7Sopenharmony_ci 650e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~2i~, v~2i+1~, v~2i+2~, v~2i+6~, v~2i+4~, 651e5c31af7Sopenharmony_ci v~2i+3~}# when [eq]#i=0# 652e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~2i~, v~2i+3~, v~2i+4~, v~2i+6~, v~2i+2~, 653e5c31af7Sopenharmony_ci v~2i-2~}# when [eq]#i>0#, [eq]#i<n-1#, and [eq]#i%2=1# 654e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~2i~, v~2i-2~, v~2i+2~, v~2i+6~, v~2i+4~, 655e5c31af7Sopenharmony_ci v~2i+3~}# when [eq]#i>0#, [eq]#i<n-1#, and [eq]#i%2=0# 656e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~2i~, v~2i+3~, v~2i+4~, v~2i+5~, v~2i+2~, 657e5c31af7Sopenharmony_ci v~2i-2~}# when [eq]#i=n-1# and [eq]#i%2=1# 658e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~2i~, v~2i-2~, v~2i+2~, v~2i+5~, v~2i+4~, 659e5c31af7Sopenharmony_ci v~2i+3~}# when [eq]#i=n-1# and [eq]#i%2=0# 660e5c31af7Sopenharmony_ci 661e5c31af7Sopenharmony_ciA triangle primitive is described by the first, third, and fifth vertices of 662e5c31af7Sopenharmony_cithe total primitive in all cases, with the remaining three vertices only 663e5c31af7Sopenharmony_ciaccessible in a <<geometry,geometry shader>>. 664e5c31af7Sopenharmony_ci 665e5c31af7Sopenharmony_ci[NOTE] 666e5c31af7Sopenharmony_ci.Note 667e5c31af7Sopenharmony_ci==== 668e5c31af7Sopenharmony_ciThe ordering of the vertices in each successive triangle is altered so that 669e5c31af7Sopenharmony_cithe winding order is consistent throughout the strip. 670e5c31af7Sopenharmony_ci==== 671e5c31af7Sopenharmony_ci 672e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 673e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 674e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, the 675e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 676e5c31af7Sopenharmony_ciifndef::VK_EXT_provoking_vertex[] 677e5c31af7Sopenharmony_ciThe 678e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 679e5c31af7Sopenharmony_ciprovoking vertex for [eq]#p~i~# is always [eq]#v~2i~#. 680e5c31af7Sopenharmony_ci 681e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_strip_with_adjacency.svg[align="center",opts="{imageopts}"] 682e5c31af7Sopenharmony_ci 683e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 684e5c31af7Sopenharmony_ciWhen the pname:provokingVertexMode is 685e5c31af7Sopenharmony_ciename:VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT, the provoking vertex for 686e5c31af7Sopenharmony_ci[eq]#p~i~# is always [eq]#v~2i+4~#. 687e5c31af7Sopenharmony_ci 688e5c31af7Sopenharmony_ciimage::{images}/primitive_topology_triangle_strip_with_adjacency_last.svg[align="center",opts="{imageopts}"] 689e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 690e5c31af7Sopenharmony_ci 691e5c31af7Sopenharmony_ci 692e5c31af7Sopenharmony_ci[[drawing-patch-lists]] 693e5c31af7Sopenharmony_ci=== Patch Lists 694e5c31af7Sopenharmony_ci 695e5c31af7Sopenharmony_ciWhen the primitive topology is ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, each 696e5c31af7Sopenharmony_ciconsecutive set of [eq]#m# vertices defines a single patch primitive, 697e5c31af7Sopenharmony_ciaccording to the equation: 698e5c31af7Sopenharmony_ci 699e5c31af7Sopenharmony_ci {empty}:: [eq]#p~i~ = {v~mi~, v~mi+1~, ..., v~mi+(m-2)~, v~mi+(m-1)~}# 700e5c31af7Sopenharmony_ci 701e5c31af7Sopenharmony_ciwhere [eq]#m# is equal to 702e5c31af7Sopenharmony_cislink:VkPipelineTessellationStateCreateInfo::pname:patchControlPoints. 703e5c31af7Sopenharmony_ci 704e5c31af7Sopenharmony_ciPatch lists are never passed to <<vertexpostproc, vertex post-processing>>, 705e5c31af7Sopenharmony_ciand as such no provoking vertex is defined for patch primitives. 706e5c31af7Sopenharmony_ciThe number of primitives generated is equal to 707e5c31af7Sopenharmony_ci[eq]#{lfloor}pname:vertexCount/m{rfloor}#. 708e5c31af7Sopenharmony_ci 709e5c31af7Sopenharmony_ciThe vertices comprising a patch have no implied geometry, and are used as 710e5c31af7Sopenharmony_ciinputs to tessellation shaders and the fixed-function tessellator to 711e5c31af7Sopenharmony_cigenerate new point, line, or triangle primitives. 712e5c31af7Sopenharmony_ci 713e5c31af7Sopenharmony_ci 714e5c31af7Sopenharmony_ci[[drawing-primitive-order]] 715e5c31af7Sopenharmony_ci== Primitive Order 716e5c31af7Sopenharmony_ci 717e5c31af7Sopenharmony_ciPrimitives generated by <<drawing, drawing commands>> progress through the 718e5c31af7Sopenharmony_cistages of the <<synchronization-pipeline-graphics, graphics pipeline>> in 719e5c31af7Sopenharmony_ci_primitive order_. 720e5c31af7Sopenharmony_ciPrimitive order is initially determined in the following way: 721e5c31af7Sopenharmony_ci 722e5c31af7Sopenharmony_ci . Submission order determines the initial ordering 723e5c31af7Sopenharmony_ci . For indirect drawing commands, the order in which accessed instances of 724e5c31af7Sopenharmony_ci the slink:VkDrawIndirectCommand are stored in pname:buffer, from lower 725e5c31af7Sopenharmony_ci indirect buffer addresses to higher addresses. 726e5c31af7Sopenharmony_ci . If a drawing command includes multiple instances, the order in which 727e5c31af7Sopenharmony_ci instances are executed, from lower numbered instances to higher. 728e5c31af7Sopenharmony_ci . The order in which primitives are specified by a drawing command: 729e5c31af7Sopenharmony_ci ** For non-indexed draws, from vertices with a lower numbered 730e5c31af7Sopenharmony_ci code:vertexIndex to a higher numbered code:vertexIndex. 731e5c31af7Sopenharmony_ci ** For indexed draws, vertices sourced from a lower index buffer addresses 732e5c31af7Sopenharmony_ci to higher addresses. 733e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 734e5c31af7Sopenharmony_ci ** For draws using mesh shaders, the order is provided by <<mesh-ordering, 735e5c31af7Sopenharmony_ci mesh shading>>. 736e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 737e5c31af7Sopenharmony_ci 738e5c31af7Sopenharmony_ciWithin this order implementations further sort primitives: 739e5c31af7Sopenharmony_ci 740e5c31af7Sopenharmony_ci[start=5] 741e5c31af7Sopenharmony_ci . If tessellation shading is active, by an implementation-dependent order 742e5c31af7Sopenharmony_ci of new primitives generated by <<tessellation-primitive-order, 743e5c31af7Sopenharmony_ci tessellation>>. 744e5c31af7Sopenharmony_ci . If geometry shading is active, by the order new primitives are generated 745e5c31af7Sopenharmony_ci by <<geometry-ordering, geometry shading>>. 746e5c31af7Sopenharmony_ci . If the <<primsrast-polygonmode,polygon mode>> is not 747e5c31af7Sopenharmony_ci ename:VK_POLYGON_MODE_FILL, 748e5c31af7Sopenharmony_ciifdef::VK_NV_fill_rectangle[] 749e5c31af7Sopenharmony_ci or ename:VK_POLYGON_MODE_FILL_RECTANGLE_NV, 750e5c31af7Sopenharmony_ciendif::VK_NV_fill_rectangle[] 751e5c31af7Sopenharmony_ci by an implementation-dependent ordering of the new primitives generated 752e5c31af7Sopenharmony_ci within the original primitive. 753e5c31af7Sopenharmony_ci 754e5c31af7Sopenharmony_ciPrimitive order is later used to define <<primsrast-order, rasterization 755e5c31af7Sopenharmony_ciorder>>, which determines the order in which fragments output results to a 756e5c31af7Sopenharmony_ciframebuffer. 757e5c31af7Sopenharmony_ci 758e5c31af7Sopenharmony_ci 759e5c31af7Sopenharmony_ci[[drawing-primitive-shading]] 760e5c31af7Sopenharmony_ci== Programmable Primitive Shading 761e5c31af7Sopenharmony_ci 762e5c31af7Sopenharmony_ciOnce primitives are assembled, they proceed to the vertex shading stage of 763e5c31af7Sopenharmony_cithe pipeline. 764e5c31af7Sopenharmony_ciIf the draw includes multiple instances, then the set of primitives is sent 765e5c31af7Sopenharmony_cito the vertex shading stage multiple times, once for each instance. 766e5c31af7Sopenharmony_ci 767e5c31af7Sopenharmony_ciIt is implementation-dependent whether vertex shading occurs on vertices 768e5c31af7Sopenharmony_cithat are discarded as part of incomplete primitives, but if it does occur 769e5c31af7Sopenharmony_cithen it operates as if they were vertices in complete primitives and such 770e5c31af7Sopenharmony_ciinvocations can: have side effects. 771e5c31af7Sopenharmony_ci 772e5c31af7Sopenharmony_ciVertex shading receives two per-vertex inputs from the primitive assembly 773e5c31af7Sopenharmony_cistage - the code:vertexIndex and the code:instanceIndex. 774e5c31af7Sopenharmony_ciHow these values are generated is defined below, with each command. 775e5c31af7Sopenharmony_ci 776e5c31af7Sopenharmony_ciDrawing commands fall roughly into two categories: 777e5c31af7Sopenharmony_ci 778e5c31af7Sopenharmony_ci * Non-indexed drawing commands present a sequential code:vertexIndex to 779e5c31af7Sopenharmony_ci the vertex shader. 780e5c31af7Sopenharmony_ci The sequential index is generated automatically by the device (see 781e5c31af7Sopenharmony_ci <<fxvertex,Fixed-Function Vertex Processing>> for details on both 782e5c31af7Sopenharmony_ci specifying the vertex attributes indexed by code:vertexIndex, as well as 783e5c31af7Sopenharmony_ci binding vertex buffers containing those attributes to a command buffer). 784e5c31af7Sopenharmony_ci These commands are: 785e5c31af7Sopenharmony_ci ** flink:vkCmdDraw 786e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndirect 787e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 788e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndirectCount 789e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 790e5c31af7Sopenharmony_ciifdef::VK_KHR_draw_indirect_count[] 791e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndirectCountKHR 792e5c31af7Sopenharmony_ciendif::VK_KHR_draw_indirect_count[] 793e5c31af7Sopenharmony_ciifdef::VK_AMD_draw_indirect_count[] 794e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndirectCountAMD 795e5c31af7Sopenharmony_ciendif::VK_AMD_draw_indirect_count[] 796e5c31af7Sopenharmony_ciifdef::VK_EXT_multi_draw[] 797e5c31af7Sopenharmony_ci ** flink:vkCmdDrawMultiEXT 798e5c31af7Sopenharmony_ciendif::VK_EXT_multi_draw[] 799e5c31af7Sopenharmony_ci * Indexed drawing commands read index values from an _index buffer_ and 800e5c31af7Sopenharmony_ci use this to compute the code:vertexIndex value for the vertex shader. 801e5c31af7Sopenharmony_ci These commands are: 802e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndexed 803e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndexedIndirect 804e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 805e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndexedIndirectCount 806e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 807e5c31af7Sopenharmony_ciifdef::VK_KHR_draw_indirect_count[] 808e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndexedIndirectCountKHR 809e5c31af7Sopenharmony_ciendif::VK_KHR_draw_indirect_count[] 810e5c31af7Sopenharmony_ciifdef::VK_AMD_draw_indirect_count[] 811e5c31af7Sopenharmony_ci ** flink:vkCmdDrawIndexedIndirectCountAMD 812e5c31af7Sopenharmony_ciendif::VK_AMD_draw_indirect_count[] 813e5c31af7Sopenharmony_ciifdef::VK_EXT_multi_draw[] 814e5c31af7Sopenharmony_ci ** flink:vkCmdDrawMultiIndexedEXT 815e5c31af7Sopenharmony_ciendif::VK_EXT_multi_draw[] 816e5c31af7Sopenharmony_ci 817e5c31af7Sopenharmony_ci 818e5c31af7Sopenharmony_ci[open,refpage='vkCmdBindIndexBuffer',desc='Bind an index buffer to a command buffer',type='protos'] 819e5c31af7Sopenharmony_ci-- 820e5c31af7Sopenharmony_ciTo bind an index buffer to a command buffer, call: 821e5c31af7Sopenharmony_ci 822e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBindIndexBuffer.txt[] 823e5c31af7Sopenharmony_ci 824e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 825e5c31af7Sopenharmony_ci recorded. 826e5c31af7Sopenharmony_ci * pname:buffer is the buffer being bound. 827e5c31af7Sopenharmony_ci * pname:offset is the starting offset in bytes within pname:buffer used in 828e5c31af7Sopenharmony_ci index buffer address calculations. 829e5c31af7Sopenharmony_ci * pname:indexType is a elink:VkIndexType value specifying the size of the 830e5c31af7Sopenharmony_ci indices. 831e5c31af7Sopenharmony_ci 832e5c31af7Sopenharmony_ci.Valid Usage 833e5c31af7Sopenharmony_ci**** 834e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindIndexBuffer-offset-00431]] 835e5c31af7Sopenharmony_ci pname:offset must: be less than the size of pname:buffer 836e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindIndexBuffer-offset-00432]] 837e5c31af7Sopenharmony_ci The sum of pname:offset and the address of the range of 838e5c31af7Sopenharmony_ci sname:VkDeviceMemory object that is backing pname:buffer, must: be a 839e5c31af7Sopenharmony_ci multiple of the type indicated by pname:indexType 840e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindIndexBuffer-buffer-00433]] 841e5c31af7Sopenharmony_ci pname:buffer must: have been created with the 842e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_INDEX_BUFFER_BIT flag 843e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindIndexBuffer-buffer-00434]] 844e5c31af7Sopenharmony_ci If pname:buffer is non-sparse then it must: be bound completely and 845e5c31af7Sopenharmony_ci contiguously to a single sname:VkDeviceMemory object 846e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 847e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindIndexBuffer-indexType-02507]] 848e5c31af7Sopenharmony_ci pname:indexType must: not be ename:VK_INDEX_TYPE_NONE_KHR 849e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 850e5c31af7Sopenharmony_ciifdef::VK_EXT_index_type_uint8[] 851e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindIndexBuffer-indexType-02765]] 852e5c31af7Sopenharmony_ci If pname:indexType is ename:VK_INDEX_TYPE_UINT8_EXT, the 853e5c31af7Sopenharmony_ci <<features-indexTypeUint8,indexTypeUint8>> feature must: be enabled 854e5c31af7Sopenharmony_ciendif::VK_EXT_index_type_uint8[] 855e5c31af7Sopenharmony_ci**** 856e5c31af7Sopenharmony_ci 857e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBindIndexBuffer.txt[] 858e5c31af7Sopenharmony_ci-- 859e5c31af7Sopenharmony_ci 860e5c31af7Sopenharmony_ci[open,refpage='VkIndexType',desc='Type of index buffer indices',type='enums'] 861e5c31af7Sopenharmony_ci-- 862e5c31af7Sopenharmony_ciPossible values of flink:vkCmdBindIndexBuffer::pname:indexType, specifying 863e5c31af7Sopenharmony_cithe size of indices, are: 864e5c31af7Sopenharmony_ci 865e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkIndexType.txt[] 866e5c31af7Sopenharmony_ci 867e5c31af7Sopenharmony_ci * ename:VK_INDEX_TYPE_UINT16 specifies that indices are 16-bit unsigned 868e5c31af7Sopenharmony_ci integer values. 869e5c31af7Sopenharmony_ci * ename:VK_INDEX_TYPE_UINT32 specifies that indices are 32-bit unsigned 870e5c31af7Sopenharmony_ci integer values. 871e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 872e5c31af7Sopenharmony_ci * ename:VK_INDEX_TYPE_NONE_KHR specifies that no indices are provided. 873e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 874e5c31af7Sopenharmony_ciifdef::VK_EXT_index_type_uint8[] 875e5c31af7Sopenharmony_ci * ename:VK_INDEX_TYPE_UINT8_EXT specifies that indices are 8-bit unsigned 876e5c31af7Sopenharmony_ci integer values. 877e5c31af7Sopenharmony_ciendif::VK_EXT_index_type_uint8[] 878e5c31af7Sopenharmony_ci-- 879e5c31af7Sopenharmony_ci 880e5c31af7Sopenharmony_ciThe parameters for each drawing command are specified directly in the 881e5c31af7Sopenharmony_cicommand or read from buffer memory, depending on the command. 882e5c31af7Sopenharmony_ciDrawing commands that source their parameters from buffer memory are known 883e5c31af7Sopenharmony_cias _indirect_ drawing commands. 884e5c31af7Sopenharmony_ci 885e5c31af7Sopenharmony_ciAll drawing commands interact with the <<features-robustBufferAccess, Robust 886e5c31af7Sopenharmony_ciBuffer Access>> feature. 887e5c31af7Sopenharmony_ci 888e5c31af7Sopenharmony_ci[open,refpage='vkCmdDraw',desc='Draw primitives',type='protos'] 889e5c31af7Sopenharmony_ci-- 890e5c31af7Sopenharmony_ci:refpage: vkCmdDraw 891e5c31af7Sopenharmony_ci 892e5c31af7Sopenharmony_ciTo record a non-indexed draw, call: 893e5c31af7Sopenharmony_ci 894e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDraw.txt[] 895e5c31af7Sopenharmony_ci 896e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 897e5c31af7Sopenharmony_ci recorded. 898e5c31af7Sopenharmony_ci * pname:vertexCount is the number of vertices to draw. 899e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 900e5c31af7Sopenharmony_ci * pname:firstVertex is the index of the first vertex to draw. 901e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 902e5c31af7Sopenharmony_ci 903e5c31af7Sopenharmony_ciWhen the command is executed, primitives are assembled using the current 904e5c31af7Sopenharmony_ciprimitive topology and pname:vertexCount consecutive vertex indices with the 905e5c31af7Sopenharmony_cifirst code:vertexIndex value equal to pname:firstVertex. 906e5c31af7Sopenharmony_ciThe primitives are drawn pname:instanceCount times with code:instanceIndex 907e5c31af7Sopenharmony_cistarting with pname:firstInstance and increasing sequentially for each 908e5c31af7Sopenharmony_ciinstance. 909e5c31af7Sopenharmony_ciThe assembled primitives execute the bound graphics pipeline. 910e5c31af7Sopenharmony_ci 911e5c31af7Sopenharmony_ci.Valid Usage 912e5c31af7Sopenharmony_ci**** 913e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 914e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_nonindirect_common.txt[] 915e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 916e5c31af7Sopenharmony_ci**** 917e5c31af7Sopenharmony_ci 918e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDraw.txt[] 919e5c31af7Sopenharmony_ci-- 920e5c31af7Sopenharmony_ci 921e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawIndexed',desc='Draw primitives with indexed vertices',type='protos'] 922e5c31af7Sopenharmony_ci-- 923e5c31af7Sopenharmony_ci:refpage: vkCmdDrawIndexed 924e5c31af7Sopenharmony_ci 925e5c31af7Sopenharmony_ciTo record an indexed draw, call: 926e5c31af7Sopenharmony_ci 927e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndexed.txt[] 928e5c31af7Sopenharmony_ci 929e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 930e5c31af7Sopenharmony_ci recorded. 931e5c31af7Sopenharmony_ci * pname:indexCount is the number of vertices to draw. 932e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 933e5c31af7Sopenharmony_ci * pname:firstIndex is the base index within the index buffer. 934e5c31af7Sopenharmony_ci * pname:vertexOffset is the value added to the vertex index before 935e5c31af7Sopenharmony_ci indexing into the vertex buffer. 936e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 937e5c31af7Sopenharmony_ci 938e5c31af7Sopenharmony_ciWhen the command is executed, primitives are assembled using the current 939e5c31af7Sopenharmony_ciprimitive topology and pname:indexCount vertices whose indices are retrieved 940e5c31af7Sopenharmony_cifrom the index buffer. 941e5c31af7Sopenharmony_ciThe index buffer is treated as an array of tightly packed unsigned integers 942e5c31af7Sopenharmony_ciof size defined by the flink:vkCmdBindIndexBuffer::pname:indexType parameter 943e5c31af7Sopenharmony_ciwith which the buffer was bound. 944e5c31af7Sopenharmony_ci 945e5c31af7Sopenharmony_ciThe first vertex index is at an offset of [eq]#pname:firstIndex {times} 946e5c31af7Sopenharmony_cicode:indexSize {plus} pname:offset# within the bound index buffer, where 947e5c31af7Sopenharmony_cipname:offset is the offset specified by fname:vkCmdBindIndexBuffer and 948e5c31af7Sopenharmony_cicode:indexSize is the byte size of the type specified by pname:indexType. 949e5c31af7Sopenharmony_ciSubsequent index values are retrieved from consecutive locations in the 950e5c31af7Sopenharmony_ciindex buffer. 951e5c31af7Sopenharmony_ciIndices are first compared to the primitive restart value, then zero 952e5c31af7Sopenharmony_ciextended to 32 bits (if the code:indexType is 953e5c31af7Sopenharmony_ciifdef::VK_EXT_index_type_uint8[] 954e5c31af7Sopenharmony_ciename:VK_INDEX_TYPE_UINT8_EXT or 955e5c31af7Sopenharmony_ciendif::VK_EXT_index_type_uint8[] 956e5c31af7Sopenharmony_ciename:VK_INDEX_TYPE_UINT16) and have pname:vertexOffset added to them, 957e5c31af7Sopenharmony_cibefore being supplied as the code:vertexIndex value. 958e5c31af7Sopenharmony_ci 959e5c31af7Sopenharmony_ciThe primitives are drawn pname:instanceCount times with code:instanceIndex 960e5c31af7Sopenharmony_cistarting with pname:firstInstance and increasing sequentially for each 961e5c31af7Sopenharmony_ciinstance. 962e5c31af7Sopenharmony_ciThe assembled primitives execute the bound graphics pipeline. 963e5c31af7Sopenharmony_ci 964e5c31af7Sopenharmony_ci.Valid Usage 965e5c31af7Sopenharmony_ci**** 966e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 967e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_nonindirect_common.txt[] 968e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 969e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexed-firstIndex-04932]] 970e5c31af7Sopenharmony_ci [eq]#(code:indexSize {times} (pname:firstIndex {plus} pname:indexCount) 971e5c31af7Sopenharmony_ci {plus} pname:offset)# must: be less than or equal to the size of the 972e5c31af7Sopenharmony_ci bound index buffer, with code:indexSize being based on the type 973e5c31af7Sopenharmony_ci specified by pname:indexType, where the index buffer, pname:indexType, 974e5c31af7Sopenharmony_ci and pname:offset are specified via fname:vkCmdBindIndexBuffer 975e5c31af7Sopenharmony_ci**** 976e5c31af7Sopenharmony_ci 977e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawIndexed.txt[] 978e5c31af7Sopenharmony_ci-- 979e5c31af7Sopenharmony_ci 980e5c31af7Sopenharmony_ciifdef::VK_EXT_multi_draw[] 981e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawMultiEXT',desc='Draw primitives',type='protos'] 982e5c31af7Sopenharmony_ci-- 983e5c31af7Sopenharmony_ci:refpage: vkCmdDrawMultiEXT 984e5c31af7Sopenharmony_ci 985e5c31af7Sopenharmony_ciTo record an ordered sequence of drawing operations which have no state 986e5c31af7Sopenharmony_cichanges between them, call: 987e5c31af7Sopenharmony_ci 988e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawMultiEXT.txt[] 989e5c31af7Sopenharmony_ci 990e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 991e5c31af7Sopenharmony_ci recorded. 992e5c31af7Sopenharmony_ci * pname:drawCount is the number of draws to execute, and can: be zero. 993e5c31af7Sopenharmony_ci * pname:pVertexInfo is a pointer to an array of slink:VkMultiDrawInfoEXT 994e5c31af7Sopenharmony_ci with vertex information to be drawn. 995e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 996e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 997e5c31af7Sopenharmony_ci * pname:stride is the byte stride between consecutive elements of 998e5c31af7Sopenharmony_ci pname:pVertexInfo. 999e5c31af7Sopenharmony_ci 1000e5c31af7Sopenharmony_cipname:drawCount draws are executed with parameters taken from 1001e5c31af7Sopenharmony_cipname:pVertexInfo. 1002e5c31af7Sopenharmony_ciThe number of draw commands recorded is pname:drawCount, with each command 1003e5c31af7Sopenharmony_cireading, sequentially, a pname:firstVertex and a pname:vertexCount from 1004e5c31af7Sopenharmony_cipname:pVertexInfo. 1005e5c31af7Sopenharmony_ci 1006e5c31af7Sopenharmony_ci.Valid Usage 1007e5c31af7Sopenharmony_ci**** 1008e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1009e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_nonindirect_common.txt[] 1010e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1011e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiEXT-None-04933]] 1012e5c31af7Sopenharmony_ci The <<features-multiDraw,multiDraw>> feature must: be enabled 1013e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiEXT-drawCount-04934]] 1014e5c31af7Sopenharmony_ci pname:drawCount must: be less than 1015e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceMultiDrawPropertiesEXT::pname:maxMultiDrawCount 1016e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiEXT-drawCount-04935]] 1017e5c31af7Sopenharmony_ci If pname:drawCount is greater than zero, pname:pVertexInfo must: be a 1018e5c31af7Sopenharmony_ci valid pointer to memory containing one or more valid instances of 1019e5c31af7Sopenharmony_ci slink:VkMultiDrawInfoEXT structures 1020e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiEXT-stride-04936]] 1021e5c31af7Sopenharmony_ci pname:stride must be a multiple of 4 1022e5c31af7Sopenharmony_ci**** 1023e5c31af7Sopenharmony_ci 1024e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawMultiEXT.txt[] 1025e5c31af7Sopenharmony_ci-- 1026e5c31af7Sopenharmony_ci 1027e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawMultiIndexedEXT',desc='Draw primitives',type='protos'] 1028e5c31af7Sopenharmony_ci-- 1029e5c31af7Sopenharmony_ci:refpage: vkCmdDrawMultiIndexedEXT 1030e5c31af7Sopenharmony_ci 1031e5c31af7Sopenharmony_ciTo record an ordered sequence of indexed drawing operations which have no 1032e5c31af7Sopenharmony_cistate changes between them, call: 1033e5c31af7Sopenharmony_ci 1034e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawMultiIndexedEXT.txt[] 1035e5c31af7Sopenharmony_ci 1036e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 1037e5c31af7Sopenharmony_ci recorded. 1038e5c31af7Sopenharmony_ci * pname:drawCount is the number of draws to execute, and can: be zero. 1039e5c31af7Sopenharmony_ci * pname:pIndexInfo is a pointer to an array of 1040e5c31af7Sopenharmony_ci slink:VkMultiDrawIndexedInfoEXT with index information to be drawn. 1041e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 1042e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 1043e5c31af7Sopenharmony_ci * pname:stride is the byte stride between consecutive elements of 1044e5c31af7Sopenharmony_ci pname:pIndexInfo. 1045e5c31af7Sopenharmony_ci * pname:pVertexOffset is `NULL` or a pointer to the value added to the 1046e5c31af7Sopenharmony_ci vertex index before indexing into the vertex buffer. 1047e5c31af7Sopenharmony_ci When specified, sname:VkMultiDrawIndexedInfoEXT::pname:offset is 1048e5c31af7Sopenharmony_ci ignored. 1049e5c31af7Sopenharmony_ci 1050e5c31af7Sopenharmony_cipname:drawCount indexed draws are executed with parameters taken from 1051e5c31af7Sopenharmony_cipname:pIndexInfo. 1052e5c31af7Sopenharmony_ciThe number of draw commands recorded is pname:drawCount, with each command 1053e5c31af7Sopenharmony_cireading, sequentially, a pname:firstIndex and an pname:indexCount from 1054e5c31af7Sopenharmony_cipname:pIndexInfo. 1055e5c31af7Sopenharmony_ciIf pname:pVertexOffset is `NULL`, a pname:vertexOffset is also read from 1056e5c31af7Sopenharmony_cipname:pIndexInfo, otherwise the value from dereferencing pname:pVertexOffset 1057e5c31af7Sopenharmony_ciis used. 1058e5c31af7Sopenharmony_ci 1059e5c31af7Sopenharmony_ci.Valid Usage 1060e5c31af7Sopenharmony_ci**** 1061e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1062e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_nonindirect_common.txt[] 1063e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1064e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiIndexedEXT-None-04937]] 1065e5c31af7Sopenharmony_ci The <<features-multiDraw,multiDraw>> feature must: be enabled 1066e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiIndexedEXT-firstIndex-04938]] 1067e5c31af7Sopenharmony_ci [eq]#(code:indexSize {times} (pname:firstIndex {plus} pname:indexCount) 1068e5c31af7Sopenharmony_ci {plus} pname:offset)# must: be less than or equal to the size of the 1069e5c31af7Sopenharmony_ci bound index buffer, with code:indexSize being based on the type 1070e5c31af7Sopenharmony_ci specified by pname:indexType, where the index buffer, pname:indexType, 1071e5c31af7Sopenharmony_ci and pname:offset are specified via fname:vkCmdBindIndexBuffer 1072e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiIndexedEXT-drawCount-04939]] 1073e5c31af7Sopenharmony_ci pname:drawCount must: be less than 1074e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceMultiDrawPropertiesEXT::pname:maxMultiDrawCount 1075e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiIndexedEXT-drawCount-04940]] 1076e5c31af7Sopenharmony_ci If pname:drawCount is greater than zero, pname:pIndexInfo must: be a 1077e5c31af7Sopenharmony_ci valid pointer to memory containing one or more valid instances of 1078e5c31af7Sopenharmony_ci slink:VkMultiDrawIndexedInfoEXT structures 1079e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawMultiIndexedEXT-stride-04941]] 1080e5c31af7Sopenharmony_ci pname:stride must be a multiple of 4 1081e5c31af7Sopenharmony_ci**** 1082e5c31af7Sopenharmony_ci 1083e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawMultiIndexedEXT.txt[] 1084e5c31af7Sopenharmony_ci-- 1085e5c31af7Sopenharmony_ci 1086e5c31af7Sopenharmony_ci[open,refpage='VkMultiDrawInfoEXT',desc='Structure specifying a multi-draw command',type='structs',xrefs='vkCmdDrawMultiEXT'] 1087e5c31af7Sopenharmony_ci-- 1088e5c31af7Sopenharmony_ci 1089e5c31af7Sopenharmony_ciThe sname:VkMultiDrawInfoEXT structure is defined as: 1090e5c31af7Sopenharmony_ci 1091e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMultiDrawInfoEXT.txt[] 1092e5c31af7Sopenharmony_ci 1093e5c31af7Sopenharmony_ci * pname:firstVertex is the first vertex to draw. 1094e5c31af7Sopenharmony_ci * pname:vertexCount is the number of vertices to draw. 1095e5c31af7Sopenharmony_ci 1096e5c31af7Sopenharmony_ciThe members of sname:VkMultiDrawInfoEXT have the same meaning as the 1097e5c31af7Sopenharmony_cipname:firstVertex and pname:vertexCount parameters in flink:vkCmdDraw. 1098e5c31af7Sopenharmony_ci 1099e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMultiDrawInfoEXT.txt[] 1100e5c31af7Sopenharmony_ci 1101e5c31af7Sopenharmony_ci-- 1102e5c31af7Sopenharmony_ci 1103e5c31af7Sopenharmony_ci[open,refpage='VkMultiDrawIndexedInfoEXT',desc='Structure specifying a multi-draw command',type='structs',xrefs='vkCmdDrawMultiIndexedEXT'] 1104e5c31af7Sopenharmony_ci-- 1105e5c31af7Sopenharmony_ci 1106e5c31af7Sopenharmony_ciThe sname:VkMultiDrawIndexedInfoEXT structure is defined as: 1107e5c31af7Sopenharmony_ci 1108e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMultiDrawIndexedInfoEXT.txt[] 1109e5c31af7Sopenharmony_ci 1110e5c31af7Sopenharmony_ci * pname:firstIndex is the first index to draw. 1111e5c31af7Sopenharmony_ci * pname:indexCount is the number of vertices to draw. 1112e5c31af7Sopenharmony_ci * pname:vertexOffset is the value added to the vertex index before 1113e5c31af7Sopenharmony_ci indexing into the vertex buffer for indexed multidraws. 1114e5c31af7Sopenharmony_ci 1115e5c31af7Sopenharmony_ciThe pname:firstIndex, pname:indexCount, and pname:vertexOffset members of 1116e5c31af7Sopenharmony_cisname:VkMultiDrawIndexedInfoEXT have the same meaning as the 1117e5c31af7Sopenharmony_cipname:firstIndex, pname:indexCount, and pname:vertexOffset parameters, 1118e5c31af7Sopenharmony_cirespectively, of flink:vkCmdDrawIndexed. 1119e5c31af7Sopenharmony_ci 1120e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMultiDrawIndexedInfoEXT.txt[] 1121e5c31af7Sopenharmony_ci 1122e5c31af7Sopenharmony_ci-- 1123e5c31af7Sopenharmony_ciendif::VK_EXT_multi_draw[] 1124e5c31af7Sopenharmony_ci 1125e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawIndirect',desc='Draw primitives with indirect parameters',type='protos'] 1126e5c31af7Sopenharmony_ci-- 1127e5c31af7Sopenharmony_ci:refpage: vkCmdDrawIndirect 1128e5c31af7Sopenharmony_ci 1129e5c31af7Sopenharmony_ciTo record a non-indexed indirect drawing command, call: 1130e5c31af7Sopenharmony_ci 1131e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndirect.txt[] 1132e5c31af7Sopenharmony_ci 1133e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 1134e5c31af7Sopenharmony_ci recorded. 1135e5c31af7Sopenharmony_ci * pname:buffer is the buffer containing draw parameters. 1136e5c31af7Sopenharmony_ci * pname:offset is the byte offset into pname:buffer where parameters 1137e5c31af7Sopenharmony_ci begin. 1138e5c31af7Sopenharmony_ci * pname:drawCount is the number of draws to execute, and can: be zero. 1139e5c31af7Sopenharmony_ci * pname:stride is the byte stride between successive sets of draw 1140e5c31af7Sopenharmony_ci parameters. 1141e5c31af7Sopenharmony_ci 1142e5c31af7Sopenharmony_cifname:vkCmdDrawIndirect behaves similarly to flink:vkCmdDraw except that the 1143e5c31af7Sopenharmony_ciparameters are read by the device from a buffer during execution. 1144e5c31af7Sopenharmony_cipname:drawCount draws are executed by the command, with parameters taken 1145e5c31af7Sopenharmony_cifrom pname:buffer starting at pname:offset and increasing by pname:stride 1146e5c31af7Sopenharmony_cibytes for each successive draw. 1147e5c31af7Sopenharmony_ciThe parameters of each draw are encoded in an array of 1148e5c31af7Sopenharmony_cislink:VkDrawIndirectCommand structures. 1149e5c31af7Sopenharmony_ciIf pname:drawCount is less than or equal to one, pname:stride is ignored. 1150e5c31af7Sopenharmony_ci 1151e5c31af7Sopenharmony_ci.Valid Usage 1152e5c31af7Sopenharmony_ci**** 1153e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1154e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1155e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_indirect_common.txt[] 1156e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_indirect_drawcount.txt[] 1157e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirect-firstInstance-00478]] 1158e5c31af7Sopenharmony_ci If the <<features-drawIndirectFirstInstance,drawIndirectFirstInstance>> 1159e5c31af7Sopenharmony_ci feature is not enabled, all the pname:firstInstance members of the 1160e5c31af7Sopenharmony_ci sname:VkDrawIndirectCommand structures accessed by this command must: be 1161e5c31af7Sopenharmony_ci code:0 1162e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirect-drawCount-00476]] 1163e5c31af7Sopenharmony_ci If pname:drawCount is greater than `1`, pname:stride must: be a multiple 1164e5c31af7Sopenharmony_ci of `4` and must: be greater than or equal to 1165e5c31af7Sopenharmony_ci code:sizeof(sname:VkDrawIndirectCommand) 1166e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirect-drawCount-00487]] 1167e5c31af7Sopenharmony_ci If pname:drawCount is equal to `1`, [eq]#(pname:offset {plus} 1168e5c31af7Sopenharmony_ci code:sizeof(slink:VkDrawIndirectCommand))# must: be less than or equal 1169e5c31af7Sopenharmony_ci to the size of pname:buffer 1170e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirect-drawCount-00488]] 1171e5c31af7Sopenharmony_ci If pname:drawCount is greater than `1`, [eq]#(pname:stride {times} 1172e5c31af7Sopenharmony_ci (pname:drawCount - 1) {plus} pname:offset {plus} 1173e5c31af7Sopenharmony_ci code:sizeof(slink:VkDrawIndirectCommand))# must: be less than or equal 1174e5c31af7Sopenharmony_ci to the size of pname:buffer 1175e5c31af7Sopenharmony_ci**** 1176e5c31af7Sopenharmony_ci 1177e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawIndirect.txt[] 1178e5c31af7Sopenharmony_ci-- 1179e5c31af7Sopenharmony_ci 1180e5c31af7Sopenharmony_ci[open,refpage='VkDrawIndirectCommand',desc='Structure specifying a indirect drawing command',type='structs',xrefs='vkCmdDrawIndirect'] 1181e5c31af7Sopenharmony_ci-- 1182e5c31af7Sopenharmony_ciThe sname:VkDrawIndirectCommand structure is defined as: 1183e5c31af7Sopenharmony_ci 1184e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDrawIndirectCommand.txt[] 1185e5c31af7Sopenharmony_ci 1186e5c31af7Sopenharmony_ci * pname:vertexCount is the number of vertices to draw. 1187e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 1188e5c31af7Sopenharmony_ci * pname:firstVertex is the index of the first vertex to draw. 1189e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 1190e5c31af7Sopenharmony_ci 1191e5c31af7Sopenharmony_ciThe members of sname:VkDrawIndirectCommand have the same meaning as the 1192e5c31af7Sopenharmony_cisimilarly named parameters of flink:vkCmdDraw. 1193e5c31af7Sopenharmony_ci 1194e5c31af7Sopenharmony_ci.Valid Usage 1195e5c31af7Sopenharmony_ci**** 1196e5c31af7Sopenharmony_ci * [[VUID-VkDrawIndirectCommand-None-00500]] 1197e5c31af7Sopenharmony_ci For a given vertex buffer binding, any attribute data fetched must: be 1198e5c31af7Sopenharmony_ci entirely contained within the corresponding vertex buffer binding, as 1199e5c31af7Sopenharmony_ci described in <<fxvertex-input>> 1200e5c31af7Sopenharmony_ci * [[VUID-VkDrawIndirectCommand-firstInstance-00501]] 1201e5c31af7Sopenharmony_ci If the <<features-drawIndirectFirstInstance,drawIndirectFirstInstance>> 1202e5c31af7Sopenharmony_ci feature is not enabled, pname:firstInstance must: be code:0 1203e5c31af7Sopenharmony_ci**** 1204e5c31af7Sopenharmony_ci 1205e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDrawIndirectCommand.txt[] 1206e5c31af7Sopenharmony_ci 1207e5c31af7Sopenharmony_ci-- 1208e5c31af7Sopenharmony_ci 1209e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_draw_indirect_count[] 1210e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawIndirectCount',desc='Draw primitives with indirect parameters and draw count',type='protos',alias='vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountAMD'] 1211e5c31af7Sopenharmony_ci-- 1212e5c31af7Sopenharmony_ci:refpage: vkCmdDrawIndirectCount 1213e5c31af7Sopenharmony_ci 1214e5c31af7Sopenharmony_ciTo record a non-indexed draw call with a draw call count sourced from a 1215e5c31af7Sopenharmony_cibuffer, call: 1216e5c31af7Sopenharmony_ci 1217e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 1218e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndirectCount.txt[] 1219e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 1220e5c31af7Sopenharmony_ci 1221e5c31af7Sopenharmony_ci// Jon: conditional logic on connective clauses with 3 forms of the command including VK_VERSION_1_2 needs work. 1222e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_draw_indirect_count[or the equivalent command] 1223e5c31af7Sopenharmony_ci 1224e5c31af7Sopenharmony_ciifdef::VK_KHR_draw_indirect_count[] 1225e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndirectCountKHR.txt[] 1226e5c31af7Sopenharmony_ciendif::VK_KHR_draw_indirect_count[] 1227e5c31af7Sopenharmony_ci 1228e5c31af7Sopenharmony_ciifdef::VK_KHR_draw_indirect_count+VK_AMD_draw_indirect_count[or the equivalent command] 1229e5c31af7Sopenharmony_ci 1230e5c31af7Sopenharmony_ciifdef::VK_AMD_draw_indirect_count[] 1231e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndirectCountAMD.txt[] 1232e5c31af7Sopenharmony_ciendif::VK_AMD_draw_indirect_count[] 1233e5c31af7Sopenharmony_ci 1234e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 1235e5c31af7Sopenharmony_ci recorded. 1236e5c31af7Sopenharmony_ci * pname:buffer is the buffer containing draw parameters. 1237e5c31af7Sopenharmony_ci * pname:offset is the byte offset into pname:buffer where parameters 1238e5c31af7Sopenharmony_ci begin. 1239e5c31af7Sopenharmony_ci * pname:countBuffer is the buffer containing the draw count. 1240e5c31af7Sopenharmony_ci * pname:countBufferOffset is the byte offset into pname:countBuffer where 1241e5c31af7Sopenharmony_ci the draw count begins. 1242e5c31af7Sopenharmony_ci * pname:maxDrawCount specifies the maximum number of draws that will be 1243e5c31af7Sopenharmony_ci executed. 1244e5c31af7Sopenharmony_ci The actual number of executed draw calls is the minimum of the count 1245e5c31af7Sopenharmony_ci specified in pname:countBuffer and pname:maxDrawCount. 1246e5c31af7Sopenharmony_ci * pname:stride is the byte stride between successive sets of draw 1247e5c31af7Sopenharmony_ci parameters. 1248e5c31af7Sopenharmony_ci 1249e5c31af7Sopenharmony_cifname:vkCmdDrawIndirectCount behaves similarly to flink:vkCmdDrawIndirect 1250e5c31af7Sopenharmony_ciexcept that the draw count is read by the device from a buffer during 1251e5c31af7Sopenharmony_ciexecution. 1252e5c31af7Sopenharmony_ciThe command will read an unsigned 32-bit integer from pname:countBuffer 1253e5c31af7Sopenharmony_cilocated at pname:countBufferOffset and use this as the draw count. 1254e5c31af7Sopenharmony_ci 1255e5c31af7Sopenharmony_ci.Valid Usage 1256e5c31af7Sopenharmony_ci**** 1257e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1258e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1259e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_indirect_common.txt[] 1260e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_indirect_count_common.txt[] 1261e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectCount-stride-03110]] 1262e5c31af7Sopenharmony_ci pname:stride must: be a multiple of `4` and must: be greater than or 1263e5c31af7Sopenharmony_ci equal to sizeof(sname:VkDrawIndirectCommand) 1264e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectCount-maxDrawCount-03111]] 1265e5c31af7Sopenharmony_ci If pname:maxDrawCount is greater than or equal to `1`, 1266e5c31af7Sopenharmony_ci [eq]#(pname:stride {times} (pname:maxDrawCount - 1) {plus} pname:offset 1267e5c31af7Sopenharmony_ci {plus} sizeof(sname:VkDrawIndirectCommand))# must: be less than or equal 1268e5c31af7Sopenharmony_ci to the size of pname:buffer 1269e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectCount-countBuffer-03121]] 1270e5c31af7Sopenharmony_ci If the count stored in pname:countBuffer is equal to `1`, 1271e5c31af7Sopenharmony_ci [eq]#(pname:offset {plus} sizeof(sname:VkDrawIndirectCommand))# must: be 1272e5c31af7Sopenharmony_ci less than or equal to the size of pname:buffer 1273e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectCount-countBuffer-03122]] 1274e5c31af7Sopenharmony_ci If the count stored in pname:countBuffer is greater than `1`, 1275e5c31af7Sopenharmony_ci [eq]#(pname:stride {times} (pname:drawCount - 1) {plus} pname:offset 1276e5c31af7Sopenharmony_ci {plus} sizeof(sname:VkDrawIndirectCommand))# must: be less than or equal 1277e5c31af7Sopenharmony_ci to the size of pname:buffer 1278e5c31af7Sopenharmony_ci**** 1279e5c31af7Sopenharmony_ci 1280e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawIndirectCount.txt[] 1281e5c31af7Sopenharmony_ci 1282e5c31af7Sopenharmony_ci-- 1283e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_draw_indirect_count[] 1284e5c31af7Sopenharmony_ci 1285e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawIndexedIndirect',desc='Draw primitives with indirect parameters and indexed vertices',type='protos'] 1286e5c31af7Sopenharmony_ci-- 1287e5c31af7Sopenharmony_ci:refpage: vkCmdDrawIndexedIndirect 1288e5c31af7Sopenharmony_ci 1289e5c31af7Sopenharmony_ciTo record an indexed indirect drawing command, call: 1290e5c31af7Sopenharmony_ci 1291e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndexedIndirect.txt[] 1292e5c31af7Sopenharmony_ci 1293e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 1294e5c31af7Sopenharmony_ci recorded. 1295e5c31af7Sopenharmony_ci * pname:buffer is the buffer containing draw parameters. 1296e5c31af7Sopenharmony_ci * pname:offset is the byte offset into pname:buffer where parameters 1297e5c31af7Sopenharmony_ci begin. 1298e5c31af7Sopenharmony_ci * pname:drawCount is the number of draws to execute, and can: be zero. 1299e5c31af7Sopenharmony_ci * pname:stride is the byte stride between successive sets of draw 1300e5c31af7Sopenharmony_ci parameters. 1301e5c31af7Sopenharmony_ci 1302e5c31af7Sopenharmony_cifname:vkCmdDrawIndexedIndirect behaves similarly to flink:vkCmdDrawIndexed 1303e5c31af7Sopenharmony_ciexcept that the parameters are read by the device from a buffer during 1304e5c31af7Sopenharmony_ciexecution. 1305e5c31af7Sopenharmony_cipname:drawCount draws are executed by the command, with parameters taken 1306e5c31af7Sopenharmony_cifrom pname:buffer starting at pname:offset and increasing by pname:stride 1307e5c31af7Sopenharmony_cibytes for each successive draw. 1308e5c31af7Sopenharmony_ciThe parameters of each draw are encoded in an array of 1309e5c31af7Sopenharmony_cislink:VkDrawIndexedIndirectCommand structures. 1310e5c31af7Sopenharmony_ciIf pname:drawCount is less than or equal to one, pname:stride is ignored. 1311e5c31af7Sopenharmony_ci 1312e5c31af7Sopenharmony_ci.Valid Usage 1313e5c31af7Sopenharmony_ci**** 1314e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1315e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1316e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_indirect_common.txt[] 1317e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_indirect_drawcount.txt[] 1318e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirect-drawCount-00528]] 1319e5c31af7Sopenharmony_ci If pname:drawCount is greater than `1`, pname:stride must: be a multiple 1320e5c31af7Sopenharmony_ci of `4` and must: be greater than or equal to 1321e5c31af7Sopenharmony_ci code:sizeof(sname:VkDrawIndexedIndirectCommand) 1322e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirect-firstInstance-00530]] 1323e5c31af7Sopenharmony_ci If the <<features-drawIndirectFirstInstance,drawIndirectFirstInstance>> 1324e5c31af7Sopenharmony_ci feature is not enabled, all the pname:firstInstance members of the 1325e5c31af7Sopenharmony_ci sname:VkDrawIndexedIndirectCommand structures accessed by this command 1326e5c31af7Sopenharmony_ci must: be code:0 1327e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirect-drawCount-00539]] 1328e5c31af7Sopenharmony_ci If pname:drawCount is equal to `1`, [eq]#(pname:offset {plus} 1329e5c31af7Sopenharmony_ci code:sizeof(sname:VkDrawIndexedIndirectCommand))# must: be less than or 1330e5c31af7Sopenharmony_ci equal to the size of pname:buffer 1331e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirect-drawCount-00540]] 1332e5c31af7Sopenharmony_ci If pname:drawCount is greater than `1`, [eq]#(pname:stride {times} 1333e5c31af7Sopenharmony_ci (pname:drawCount - 1) {plus} pname:offset {plus} 1334e5c31af7Sopenharmony_ci code:sizeof(sname:VkDrawIndexedIndirectCommand))# must: be less than or 1335e5c31af7Sopenharmony_ci equal to the size of pname:buffer 1336e5c31af7Sopenharmony_ci**** 1337e5c31af7Sopenharmony_ci 1338e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawIndexedIndirect.txt[] 1339e5c31af7Sopenharmony_ci-- 1340e5c31af7Sopenharmony_ci 1341e5c31af7Sopenharmony_ci[open,refpage='VkDrawIndexedIndirectCommand',desc='Structure specifying a indexed indirect drawing command',type='structs',xrefs='vkCmdDrawIndexedIndirect'] 1342e5c31af7Sopenharmony_ci-- 1343e5c31af7Sopenharmony_ciThe sname:VkDrawIndexedIndirectCommand structure is defined as: 1344e5c31af7Sopenharmony_ci 1345e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDrawIndexedIndirectCommand.txt[] 1346e5c31af7Sopenharmony_ci 1347e5c31af7Sopenharmony_ci * pname:indexCount is the number of vertices to draw. 1348e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 1349e5c31af7Sopenharmony_ci * pname:firstIndex is the base index within the index buffer. 1350e5c31af7Sopenharmony_ci * pname:vertexOffset is the value added to the vertex index before 1351e5c31af7Sopenharmony_ci indexing into the vertex buffer. 1352e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 1353e5c31af7Sopenharmony_ci 1354e5c31af7Sopenharmony_ciThe members of sname:VkDrawIndexedIndirectCommand have the same meaning as 1355e5c31af7Sopenharmony_cithe similarly named parameters of flink:vkCmdDrawIndexed. 1356e5c31af7Sopenharmony_ci 1357e5c31af7Sopenharmony_ci.Valid Usage 1358e5c31af7Sopenharmony_ci**** 1359e5c31af7Sopenharmony_ci * [[VUID-VkDrawIndexedIndirectCommand-None-00552]] 1360e5c31af7Sopenharmony_ci For a given vertex buffer binding, any attribute data fetched must: be 1361e5c31af7Sopenharmony_ci entirely contained within the corresponding vertex buffer binding, as 1362e5c31af7Sopenharmony_ci described in <<fxvertex-input>> 1363e5c31af7Sopenharmony_ci * [[VUID-VkDrawIndexedIndirectCommand-indexSize-00553]] 1364e5c31af7Sopenharmony_ci [eq]#(code:indexSize {times} (pname:firstIndex {plus} pname:indexCount) 1365e5c31af7Sopenharmony_ci {plus} pname:offset)# must: be less than or equal to the size of the 1366e5c31af7Sopenharmony_ci bound index buffer, with code:indexSize being based on the type 1367e5c31af7Sopenharmony_ci specified by pname:indexType, where the index buffer, pname:indexType, 1368e5c31af7Sopenharmony_ci and pname:offset are specified via fname:vkCmdBindIndexBuffer 1369e5c31af7Sopenharmony_ci * [[VUID-VkDrawIndexedIndirectCommand-firstInstance-00554]] 1370e5c31af7Sopenharmony_ci If the <<features-drawIndirectFirstInstance,drawIndirectFirstInstance>> 1371e5c31af7Sopenharmony_ci feature is not enabled, pname:firstInstance must: be code:0 1372e5c31af7Sopenharmony_ci**** 1373e5c31af7Sopenharmony_ci 1374e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDrawIndexedIndirectCommand.txt[] 1375e5c31af7Sopenharmony_ci-- 1376e5c31af7Sopenharmony_ci 1377e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_draw_indirect_count[] 1378e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawIndexedIndirectCount',desc='Draw parameters with indirect parameters, indexed vertices, and draw count',type='protos',alias='vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountAMD'] 1379e5c31af7Sopenharmony_ci-- 1380e5c31af7Sopenharmony_ci:refpage: vkCmdDrawIndexedIndirectCount 1381e5c31af7Sopenharmony_ci 1382e5c31af7Sopenharmony_ciTo record an indexed draw call with a draw call count sourced from a buffer, 1383e5c31af7Sopenharmony_cicall: 1384e5c31af7Sopenharmony_ci 1385e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 1386e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndexedIndirectCount.txt[] 1387e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 1388e5c31af7Sopenharmony_ci 1389e5c31af7Sopenharmony_ci// Jon: conditional logic on connective clauses with 3 forms of the command including VK_VERSION_1_2 needs work. 1390e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_draw_indirect_count[or the equivalent command] 1391e5c31af7Sopenharmony_ci 1392e5c31af7Sopenharmony_ciifdef::VK_KHR_draw_indirect_count[] 1393e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndexedIndirectCountKHR.txt[] 1394e5c31af7Sopenharmony_ciendif::VK_KHR_draw_indirect_count[] 1395e5c31af7Sopenharmony_ci 1396e5c31af7Sopenharmony_ciifdef::VK_KHR_draw_indirect_count+VK_AMD_draw_indirect_count[or the equivalent command] 1397e5c31af7Sopenharmony_ci 1398e5c31af7Sopenharmony_ciifdef::VK_AMD_draw_indirect_count[] 1399e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndexedIndirectCountAMD.txt[] 1400e5c31af7Sopenharmony_ciendif::VK_AMD_draw_indirect_count[] 1401e5c31af7Sopenharmony_ci 1402e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 1403e5c31af7Sopenharmony_ci recorded. 1404e5c31af7Sopenharmony_ci * pname:buffer is the buffer containing draw parameters. 1405e5c31af7Sopenharmony_ci * pname:offset is the byte offset into pname:buffer where parameters 1406e5c31af7Sopenharmony_ci begin. 1407e5c31af7Sopenharmony_ci * pname:countBuffer is the buffer containing the draw count. 1408e5c31af7Sopenharmony_ci * pname:countBufferOffset is the byte offset into pname:countBuffer where 1409e5c31af7Sopenharmony_ci the draw count begins. 1410e5c31af7Sopenharmony_ci * pname:maxDrawCount specifies the maximum number of draws that will be 1411e5c31af7Sopenharmony_ci executed. 1412e5c31af7Sopenharmony_ci The actual number of executed draw calls is the minimum of the count 1413e5c31af7Sopenharmony_ci specified in pname:countBuffer and pname:maxDrawCount. 1414e5c31af7Sopenharmony_ci * pname:stride is the byte stride between successive sets of draw 1415e5c31af7Sopenharmony_ci parameters. 1416e5c31af7Sopenharmony_ci 1417e5c31af7Sopenharmony_cifname:vkCmdDrawIndexedIndirectCount behaves similarly to 1418e5c31af7Sopenharmony_ciflink:vkCmdDrawIndexedIndirect except that the draw count is read by the 1419e5c31af7Sopenharmony_cidevice from a buffer during execution. 1420e5c31af7Sopenharmony_ciThe command will read an unsigned 32-bit integer from pname:countBuffer 1421e5c31af7Sopenharmony_cilocated at pname:countBufferOffset and use this as the draw count. 1422e5c31af7Sopenharmony_ci 1423e5c31af7Sopenharmony_ci.Valid Usage 1424e5c31af7Sopenharmony_ci**** 1425e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1426e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1427e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_dispatch_indirect_common.txt[] 1428e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_indirect_count_common.txt[] 1429e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirectCount-stride-03142]] 1430e5c31af7Sopenharmony_ci pname:stride must: be a multiple of `4` and must: be greater than or 1431e5c31af7Sopenharmony_ci equal to sizeof(sname:VkDrawIndexedIndirectCommand) 1432e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirectCount-maxDrawCount-03143]] 1433e5c31af7Sopenharmony_ci If pname:maxDrawCount is greater than or equal to `1`, 1434e5c31af7Sopenharmony_ci [eq]#(pname:stride {times} (pname:maxDrawCount - 1) {plus} pname:offset 1435e5c31af7Sopenharmony_ci {plus} sizeof(sname:VkDrawIndexedIndirectCommand))# must: be less than 1436e5c31af7Sopenharmony_ci or equal to the size of pname:buffer 1437e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirectCount-countBuffer-03153]] 1438e5c31af7Sopenharmony_ci If count stored in pname:countBuffer is equal to `1`, [eq]#(pname:offset 1439e5c31af7Sopenharmony_ci {plus} sizeof(sname:VkDrawIndexedIndirectCommand))# must: be less than 1440e5c31af7Sopenharmony_ci or equal to the size of pname:buffer 1441e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndexedIndirectCount-countBuffer-03154]] 1442e5c31af7Sopenharmony_ci If count stored in pname:countBuffer is greater than `1`, 1443e5c31af7Sopenharmony_ci [eq]#(pname:stride {times} (pname:drawCount - 1) {plus} pname:offset 1444e5c31af7Sopenharmony_ci {plus} sizeof(sname:VkDrawIndexedIndirectCommand))# must: be less than 1445e5c31af7Sopenharmony_ci or equal to the size of pname:buffer 1446e5c31af7Sopenharmony_ci**** 1447e5c31af7Sopenharmony_ci 1448e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawIndexedIndirectCount.txt[] 1449e5c31af7Sopenharmony_ci-- 1450e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_draw_indirect_count[] 1451e5c31af7Sopenharmony_ci 1452e5c31af7Sopenharmony_ci 1453e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 1454e5c31af7Sopenharmony_ci[[drawing-transform-feedback]] 1455e5c31af7Sopenharmony_ci=== Drawing Transform Feedback 1456e5c31af7Sopenharmony_ci 1457e5c31af7Sopenharmony_ciIt is possible to draw vertex data that was previously captured during 1458e5c31af7Sopenharmony_ciactive <<vertexpostproc-transform-feedback,transform feedback>> by binding 1459e5c31af7Sopenharmony_cione or more of the transform feedback buffers as vertex buffers. 1460e5c31af7Sopenharmony_ciA pipeline barrier is required between using the buffers as transform 1461e5c31af7Sopenharmony_cifeedback buffers and vertex buffers to ensure all writes to the transform 1462e5c31af7Sopenharmony_cifeedback buffers are visible when the data is read as vertex attributes. 1463e5c31af7Sopenharmony_ciThe source access is ename:VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT and 1464e5c31af7Sopenharmony_cithe destination access is ename:VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT for the 1465e5c31af7Sopenharmony_cipipeline stages ename:VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT and 1466e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_VERTEX_INPUT_BIT respectively. 1467e5c31af7Sopenharmony_ciThe value written to the counter buffer by 1468e5c31af7Sopenharmony_ciflink:vkCmdEndTransformFeedbackEXT can: be used to determine the vertex 1469e5c31af7Sopenharmony_cicount for the draw. 1470e5c31af7Sopenharmony_ciA pipeline barrier is required between using the counter buffer for 1471e5c31af7Sopenharmony_cifname:vkCmdEndTransformFeedbackEXT and fname:vkCmdDrawIndirectByteCountEXT 1472e5c31af7Sopenharmony_ciwhere the source access is 1473e5c31af7Sopenharmony_ciename:VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT and the destination 1474e5c31af7Sopenharmony_ciaccess is ename:VK_ACCESS_INDIRECT_COMMAND_READ_BIT for the pipeline stages 1475e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT and 1476e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT respectively. 1477e5c31af7Sopenharmony_ci 1478e5c31af7Sopenharmony_ci[open,refpage='vkCmdDrawIndirectByteCountEXT',desc='Draw primitives with indirect parameters where the vertex count is derived from the counter byte value in the counter buffer',type='protos'] 1479e5c31af7Sopenharmony_ci-- 1480e5c31af7Sopenharmony_ci:refpage: vkCmdDrawIndirectByteCountEXT 1481e5c31af7Sopenharmony_ci 1482e5c31af7Sopenharmony_ciTo record a non-indexed draw call, where the vertex count is based on a byte 1483e5c31af7Sopenharmony_cicount read from a buffer and the passed in vertex stride parameter, call: 1484e5c31af7Sopenharmony_ci 1485e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDrawIndirectByteCountEXT.txt[] 1486e5c31af7Sopenharmony_ci 1487e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command is 1488e5c31af7Sopenharmony_ci recorded. 1489e5c31af7Sopenharmony_ci * pname:instanceCount is the number of instances to draw. 1490e5c31af7Sopenharmony_ci * pname:firstInstance is the instance ID of the first instance to draw. 1491e5c31af7Sopenharmony_ci * pname:counterBuffer is the buffer handle from where the byte count is 1492e5c31af7Sopenharmony_ci read. 1493e5c31af7Sopenharmony_ci * pname:counterBufferOffset is the offset into the buffer used to read the 1494e5c31af7Sopenharmony_ci byte count, which is used to calculate the vertex count for this draw 1495e5c31af7Sopenharmony_ci call. 1496e5c31af7Sopenharmony_ci * pname:counterOffset is subtracted from the byte count read from the 1497e5c31af7Sopenharmony_ci pname:counterBuffer at the pname:counterBufferOffset 1498e5c31af7Sopenharmony_ci * pname:vertexStride is the stride in bytes between each element of the 1499e5c31af7Sopenharmony_ci vertex data that is used to calculate the vertex count from the counter 1500e5c31af7Sopenharmony_ci value. 1501e5c31af7Sopenharmony_ci This value is typically the same value that was used in the graphics 1502e5c31af7Sopenharmony_ci pipeline state when the transform feedback was captured as the 1503e5c31af7Sopenharmony_ci code:XfbStride. 1504e5c31af7Sopenharmony_ci 1505e5c31af7Sopenharmony_ciWhen the command is executed, primitives are assembled in the same way as 1506e5c31af7Sopenharmony_cidone with flink:vkCmdDraw except the pname:vertexCount is calculated based 1507e5c31af7Sopenharmony_cion the byte count read from pname:counterBuffer at offset 1508e5c31af7Sopenharmony_cipname:counterBufferOffset. 1509e5c31af7Sopenharmony_ciThe assembled primitives execute the bound graphics pipeline. 1510e5c31af7Sopenharmony_ci 1511e5c31af7Sopenharmony_ciThe effective pname:vertexCount is calculated as follows: 1512e5c31af7Sopenharmony_ci 1513e5c31af7Sopenharmony_ci[source,c] 1514e5c31af7Sopenharmony_ci~~~~ 1515e5c31af7Sopenharmony_ciconst uint32_t * counterBufferPtr = (const uint8_t *)counterBuffer.address + counterBufferOffset; 1516e5c31af7Sopenharmony_civertexCount = floor(max(0, (*counterBufferPtr - counterOffset)) / vertexStride); 1517e5c31af7Sopenharmony_ci~~~~ 1518e5c31af7Sopenharmony_ci 1519e5c31af7Sopenharmony_ciThe effective pname:firstVertex is zero. 1520e5c31af7Sopenharmony_ci 1521e5c31af7Sopenharmony_ci.Valid Usage 1522e5c31af7Sopenharmony_ci**** 1523e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_common.txt[] 1524e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/draw_vertex_binding.txt[] 1525e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-transformFeedback-02287]] 1526e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceTransformFeedbackFeaturesEXT::pname:transformFeedback 1527e5c31af7Sopenharmony_ci must: be enabled 1528e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-transformFeedbackDraw-02288]] 1529e5c31af7Sopenharmony_ci The implementation must: support 1530e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:transformFeedbackDraw 1531e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-vertexStride-02289]] 1532e5c31af7Sopenharmony_ci pname:vertexStride must: be greater than 0 and less than or equal to 1533e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceLimits::pname:maxTransformFeedbackBufferDataStride 1534e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-counterBuffer-04567]] 1535e5c31af7Sopenharmony_ci If pname:counterBuffer is non-sparse then it must: be bound completely 1536e5c31af7Sopenharmony_ci and contiguously to a single sname:VkDeviceMemory object 1537e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-counterBuffer-02290]] 1538e5c31af7Sopenharmony_ci pname:counterBuffer must: have been created with the 1539e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set 1540e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-counterBufferOffset-04568]] 1541e5c31af7Sopenharmony_ci pname:counterBufferOffset must: be a multiple of `4` 1542e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 1543e5c31af7Sopenharmony_ci * [[VUID-vkCmdDrawIndirectByteCountEXT-commandBuffer-02646]] 1544e5c31af7Sopenharmony_ci pname:commandBuffer must: not be a protected command buffer 1545e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 1546e5c31af7Sopenharmony_ci**** 1547e5c31af7Sopenharmony_ci 1548e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDrawIndirectByteCountEXT.txt[] 1549e5c31af7Sopenharmony_ci-- 1550e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 1551e5c31af7Sopenharmony_ci 1552e5c31af7Sopenharmony_ci 1553e5c31af7Sopenharmony_ciifdef::VK_EXT_conditional_rendering[] 1554e5c31af7Sopenharmony_ci[[drawing-conditional-rendering]] 1555e5c31af7Sopenharmony_ci== Conditional Rendering 1556e5c31af7Sopenharmony_ci 1557e5c31af7Sopenharmony_ciCertain rendering commands can: be executed conditionally based on a value 1558e5c31af7Sopenharmony_ciin buffer memory. 1559e5c31af7Sopenharmony_ciThese rendering commands are limited to <<drawing,drawing commands>>, 1560e5c31af7Sopenharmony_ci<<dispatch,dispatching commands>>, and clearing attachments with 1561e5c31af7Sopenharmony_ciflink:vkCmdClearAttachments within a conditional rendering block which is 1562e5c31af7Sopenharmony_cidefined by commands flink:vkCmdBeginConditionalRenderingEXT and 1563e5c31af7Sopenharmony_ciflink:vkCmdEndConditionalRenderingEXT. 1564e5c31af7Sopenharmony_ciOther rendering commands remain unaffected by conditional rendering. 1565e5c31af7Sopenharmony_ci 1566e5c31af7Sopenharmony_ci[[active-conditional-rendering]] 1567e5c31af7Sopenharmony_ciAfter beginning conditional rendering, it is considered _active_ within the 1568e5c31af7Sopenharmony_cicommand buffer it was called until it is ended with 1569e5c31af7Sopenharmony_ciflink:vkCmdEndConditionalRenderingEXT. 1570e5c31af7Sopenharmony_ci 1571e5c31af7Sopenharmony_ciConditional rendering must: begin and end in the same command buffer. 1572e5c31af7Sopenharmony_ciWhen conditional rendering is active, a primary command buffer can: execute 1573e5c31af7Sopenharmony_cisecondary command buffers if the <<features-inheritedConditionalRendering, 1574e5c31af7Sopenharmony_ciinherited conditional rendering>> feature is enabled. 1575e5c31af7Sopenharmony_ciFor a secondary command buffer to be executed while conditional rendering is 1576e5c31af7Sopenharmony_ciactive in the primary command buffer, it must: set the 1577e5c31af7Sopenharmony_cipname:conditionalRenderingEnable flag of 1578e5c31af7Sopenharmony_cislink:VkCommandBufferInheritanceConditionalRenderingInfoEXT, as described in 1579e5c31af7Sopenharmony_cithe <<commandbuffers-recording, Command Buffer Recording>> section. 1580e5c31af7Sopenharmony_ci 1581e5c31af7Sopenharmony_ciConditional rendering must: also either begin and end inside the same 1582e5c31af7Sopenharmony_cisubpass of a render pass instance, or must: both begin and end outside of a 1583e5c31af7Sopenharmony_cirender pass instance (i.e. contain entire render pass instances). 1584e5c31af7Sopenharmony_ci 1585e5c31af7Sopenharmony_ci[open,refpage='vkCmdBeginConditionalRenderingEXT',desc='Define the beginning of a conditional rendering block',type='protos'] 1586e5c31af7Sopenharmony_ci-- 1587e5c31af7Sopenharmony_ciTo begin conditional rendering, call: 1588e5c31af7Sopenharmony_ci 1589e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBeginConditionalRenderingEXT.txt[] 1590e5c31af7Sopenharmony_ci 1591e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which this command will 1592e5c31af7Sopenharmony_ci be recorded. 1593e5c31af7Sopenharmony_ci * pname:pConditionalRenderingBegin is a pointer to a 1594e5c31af7Sopenharmony_ci slink:VkConditionalRenderingBeginInfoEXT structure specifying parameters 1595e5c31af7Sopenharmony_ci of conditional rendering. 1596e5c31af7Sopenharmony_ci 1597e5c31af7Sopenharmony_ci.Valid Usage 1598e5c31af7Sopenharmony_ci**** 1599e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginConditionalRenderingEXT-None-01980]] 1600e5c31af7Sopenharmony_ci Conditional rendering must: not already be 1601e5c31af7Sopenharmony_ci <<active-conditional-rendering,active>> 1602e5c31af7Sopenharmony_ci**** 1603e5c31af7Sopenharmony_ci 1604e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBeginConditionalRenderingEXT.txt[] 1605e5c31af7Sopenharmony_ci-- 1606e5c31af7Sopenharmony_ci 1607e5c31af7Sopenharmony_ci[open,refpage='VkConditionalRenderingBeginInfoEXT',desc='Structure specifying conditional rendering begin information',type='structs'] 1608e5c31af7Sopenharmony_ci-- 1609e5c31af7Sopenharmony_ciThe sname:VkConditionalRenderingBeginInfoEXT structure is defined as: 1610e5c31af7Sopenharmony_ci 1611e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkConditionalRenderingBeginInfoEXT.txt[] 1612e5c31af7Sopenharmony_ci 1613e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1614e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1615e5c31af7Sopenharmony_ci structure. 1616e5c31af7Sopenharmony_ci * pname:buffer is a buffer containing the predicate for conditional 1617e5c31af7Sopenharmony_ci rendering. 1618e5c31af7Sopenharmony_ci * pname:offset is the byte offset into pname:buffer where the predicate is 1619e5c31af7Sopenharmony_ci located. 1620e5c31af7Sopenharmony_ci * pname:flags is a bitmask of tlink:VkConditionalRenderingFlagsEXT 1621e5c31af7Sopenharmony_ci specifying the behavior of conditional rendering. 1622e5c31af7Sopenharmony_ci 1623e5c31af7Sopenharmony_ciIf the 32-bit value at pname:offset in pname:buffer memory is zero, then the 1624e5c31af7Sopenharmony_cirendering commands are discarded, otherwise they are executed as normal. 1625e5c31af7Sopenharmony_ciIf the value of the predicate in buffer memory changes while conditional 1626e5c31af7Sopenharmony_cirendering is active, the rendering commands may: be discarded in an 1627e5c31af7Sopenharmony_ciimplementation-dependent way. 1628e5c31af7Sopenharmony_ciSome implementations may latch the value of the predicate upon beginning 1629e5c31af7Sopenharmony_ciconditional rendering while others may read it before every rendering 1630e5c31af7Sopenharmony_cicommand. 1631e5c31af7Sopenharmony_ci 1632e5c31af7Sopenharmony_ci.Valid Usage 1633e5c31af7Sopenharmony_ci**** 1634e5c31af7Sopenharmony_ci * [[VUID-VkConditionalRenderingBeginInfoEXT-buffer-01981]] 1635e5c31af7Sopenharmony_ci If pname:buffer is non-sparse then it must: be bound completely and 1636e5c31af7Sopenharmony_ci contiguously to a single sname:VkDeviceMemory object 1637e5c31af7Sopenharmony_ci * [[VUID-VkConditionalRenderingBeginInfoEXT-buffer-01982]] 1638e5c31af7Sopenharmony_ci pname:buffer must: have been created with the 1639e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT bit set 1640e5c31af7Sopenharmony_ci * [[VUID-VkConditionalRenderingBeginInfoEXT-offset-01983]] 1641e5c31af7Sopenharmony_ci pname:offset must: be less than the size of pname:buffer by at least 32 1642e5c31af7Sopenharmony_ci bits 1643e5c31af7Sopenharmony_ci * [[VUID-VkConditionalRenderingBeginInfoEXT-offset-01984]] 1644e5c31af7Sopenharmony_ci pname:offset must: be a multiple of 4 1645e5c31af7Sopenharmony_ci**** 1646e5c31af7Sopenharmony_ci 1647e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkConditionalRenderingBeginInfoEXT.txt[] 1648e5c31af7Sopenharmony_ci 1649e5c31af7Sopenharmony_ci-- 1650e5c31af7Sopenharmony_ci 1651e5c31af7Sopenharmony_ci[open,refpage='VkConditionalRenderingFlagBitsEXT',desc='Specify the behavior of conditional rendering',type='enums'] 1652e5c31af7Sopenharmony_ci-- 1653e5c31af7Sopenharmony_ciBits which can: be set in 1654e5c31af7Sopenharmony_ciflink:vkCmdBeginConditionalRenderingEXT::pname:flags specifying the behavior 1655e5c31af7Sopenharmony_ciof conditional rendering are: 1656e5c31af7Sopenharmony_ci 1657e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkConditionalRenderingFlagBitsEXT.txt[] 1658e5c31af7Sopenharmony_ci 1659e5c31af7Sopenharmony_ci * ename:VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT specifies the condition 1660e5c31af7Sopenharmony_ci used to determine whether to discard rendering commands or not. 1661e5c31af7Sopenharmony_ci That is, if the 32-bit predicate read from pname:buffer memory at 1662e5c31af7Sopenharmony_ci pname:offset is zero, the rendering commands are not discarded, and if 1663e5c31af7Sopenharmony_ci non zero, then they are discarded. 1664e5c31af7Sopenharmony_ci-- 1665e5c31af7Sopenharmony_ci 1666e5c31af7Sopenharmony_ci[open,refpage='VkConditionalRenderingFlagsEXT',desc='Bitmask of VkConditionalRenderingFlagBitsEXT',type='flags'] 1667e5c31af7Sopenharmony_ci-- 1668e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkConditionalRenderingFlagsEXT.txt[] 1669e5c31af7Sopenharmony_ci 1670e5c31af7Sopenharmony_citname:VkConditionalRenderingFlagsEXT is a bitmask type for setting a mask of 1671e5c31af7Sopenharmony_cizero or more elink:VkConditionalRenderingFlagBitsEXT. 1672e5c31af7Sopenharmony_ci-- 1673e5c31af7Sopenharmony_ci 1674e5c31af7Sopenharmony_ci[open,refpage='vkCmdEndConditionalRenderingEXT',desc='Define the end of a conditional rendering block',type='protos'] 1675e5c31af7Sopenharmony_ci-- 1676e5c31af7Sopenharmony_ciTo end conditional rendering, call: 1677e5c31af7Sopenharmony_ci 1678e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdEndConditionalRenderingEXT.txt[] 1679e5c31af7Sopenharmony_ci 1680e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which this command will 1681e5c31af7Sopenharmony_ci be recorded. 1682e5c31af7Sopenharmony_ci 1683e5c31af7Sopenharmony_ciOnce ended, conditional rendering becomes inactive. 1684e5c31af7Sopenharmony_ci 1685e5c31af7Sopenharmony_ci.Valid Usage 1686e5c31af7Sopenharmony_ci**** 1687e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndConditionalRenderingEXT-None-01985]] 1688e5c31af7Sopenharmony_ci Conditional rendering must: be <<active-conditional-rendering,active>> 1689e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndConditionalRenderingEXT-None-01986]] 1690e5c31af7Sopenharmony_ci If conditional rendering was made 1691e5c31af7Sopenharmony_ci <<active-conditional-rendering,active>> outside of a render pass 1692e5c31af7Sopenharmony_ci instance, it must: not be ended inside a render pass instance 1693e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndConditionalRenderingEXT-None-01987]] 1694e5c31af7Sopenharmony_ci If conditional rendering was made 1695e5c31af7Sopenharmony_ci <<active-conditional-rendering,active>> within a subpass it must: be 1696e5c31af7Sopenharmony_ci ended in the same subpass 1697e5c31af7Sopenharmony_ci**** 1698e5c31af7Sopenharmony_ci 1699e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdEndConditionalRenderingEXT.txt[] 1700e5c31af7Sopenharmony_ci-- 1701e5c31af7Sopenharmony_ciendif::VK_EXT_conditional_rendering[] 1702e5c31af7Sopenharmony_ci 1703e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 1704e5c31af7Sopenharmony_ciinclude::{chapters}/VK_NV_mesh_shader/drawing.txt[] 1705e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 1706