20. Drawing Commands
Drawing commands (commands with Draw
in the name) provoke work in a
graphics pipeline.
Drawing commands are recorded into a command buffer and when executed by a
queue, will produce work which executes according to the bound graphics
pipeline.
A graphics pipeline
must be bound to a command buffer before any drawing commands are recorded
in that command buffer.
Each draw is made up of zero or more vertices and zero or more instances,
which are processed by the device and result in the assembly of primitives.
Primitives are assembled according to the pInputAssemblyState
member
of the VkGraphicsPipelineCreateInfo structure, which is of type
VkPipelineInputAssemblyStateCreateInfo
:
// Provided by VK_VERSION_1_0
typedef struct VkPipelineInputAssemblyStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineInputAssemblyStateCreateFlags flags;
VkPrimitiveTopology topology;
VkBool32 primitiveRestartEnable;
} VkPipelineInputAssemblyStateCreateInfo;
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
flags
is reserved for future use. -
topology
is a VkPrimitiveTopology defining the primitive topology, as described below. -
primitiveRestartEnable
controls whether a special vertex index value is treated as restarting the assembly of primitives. This enable only applies to indexed draws (vkCmdDrawIndexed, and vkCmdDrawIndexedIndirect), and the special index value is either 0xFFFFFFFF when theindexType
parameter ofvkCmdBindIndexBuffer
is equal toVK_INDEX_TYPE_UINT32
, or 0xFFFF whenindexType
is equal toVK_INDEX_TYPE_UINT16
. Primitive restart is not allowed for “list” topologies.
Restarting the assembly of primitives discards the most recent index values
if those elements formed an incomplete primitive, and restarts the primitive
assembly using the subsequent indices, but only assembling the immediately
following element through the end of the originally specified elements.
The primitive restart index value comparison is performed before adding the
vertexOffset
value to the index value.
-
VUID-VkPipelineInputAssemblyStateCreateInfo-topology-06252
Iftopology
isVK_PRIMITIVE_TOPOLOGY_POINT_LIST
,VK_PRIMITIVE_TOPOLOGY_LINE_LIST
,VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
,VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY
, orVK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY
,primitiveRestartEnable
must beVK_FALSE
-
VUID-VkPipelineInputAssemblyStateCreateInfo-topology-06253
Iftopology
isVK_PRIMITIVE_TOPOLOGY_PATCH_LIST
,primitiveRestartEnable
must beVK_FALSE
-
VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00429
If thegeometryShader
feature is not enabled,topology
must not be any ofVK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY
,VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY
,VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY
orVK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY
-
VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00430
If thetessellationShader
feature is not enabled,topology
must not beVK_PRIMITIVE_TOPOLOGY_PATCH_LIST
-
VUID-VkPipelineInputAssemblyStateCreateInfo-sType-sType
sType
must beVK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
-
VUID-VkPipelineInputAssemblyStateCreateInfo-pNext-pNext
pNext
must beNULL
-
VUID-VkPipelineInputAssemblyStateCreateInfo-flags-zerobitmask
flags
must be0
-
VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter
topology
must be a valid VkPrimitiveTopology value
// Provided by VK_VERSION_1_0
typedef VkFlags VkPipelineInputAssemblyStateCreateFlags;
VkPipelineInputAssemblyStateCreateFlags
is a bitmask type for setting
a mask, but is currently reserved for future use.
To dynamically control whether a special vertex index value is treated as restarting the assembly of primitives, call:
// Provided by VK_VERSION_1_3
void vkCmdSetPrimitiveRestartEnable(
VkCommandBuffer commandBuffer,
VkBool32 primitiveRestartEnable);
-
commandBuffer
is the command buffer into which the command will be recorded. -
primitiveRestartEnable
controls whether a special vertex index value is treated as restarting the assembly of primitives. It behaves in the same way asVkPipelineInputAssemblyStateCreateInfo
::primitiveRestartEnable
This command sets the primitive restart enable for subsequent drawing
commands
when the graphics pipeline is created with
VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
set in
VkPipelineDynamicStateCreateInfo::pDynamicStates
.
Otherwise, this state is specified by the
VkPipelineInputAssemblyStateCreateInfo::primitiveRestartEnable
value used to create the currently active pipeline.
-
VUID-vkCmdSetPrimitiveRestartEnable-None-08970
At least one of the following must be true:-
the value of VkApplicationInfo::
apiVersion
used to create the VkInstance parent ofcommandBuffer
is greater than or equal to Version 1.3
-
-
VUID-vkCmdSetPrimitiveRestartEnable-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdSetPrimitiveRestartEnable-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdSetPrimitiveRestartEnable-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Both |
Graphics |
State |
20.1. Primitive Topologies
Primitive topology determines how consecutive vertices are organized into primitives, and determines the type of primitive that is used at the beginning of the graphics pipeline. The effective topology for later stages of the pipeline is altered by tessellation or geometry shading (if either is in use) and depends on the execution modes of those shaders.
The primitive topologies defined by VkPrimitiveTopology are:
// Provided by VK_VERSION_1_0
typedef enum VkPrimitiveTopology {
VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0,
VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1,
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5,
VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6,
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9,
VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10,
} VkPrimitiveTopology;
-
VK_PRIMITIVE_TOPOLOGY_POINT_LIST
specifies a series of separate point primitives. -
VK_PRIMITIVE_TOPOLOGY_LINE_LIST
specifies a series of separate line primitives. -
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP
specifies a series of connected line primitives with consecutive lines sharing a vertex. -
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
specifies a series of separate triangle primitives. -
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP
specifies a series of connected triangle primitives with consecutive triangles sharing an edge. -
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN
specifies a series of connected triangle primitives with all triangles sharing a common vertex. -
VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY
specifies a series of separate line primitives with adjacency. -
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY
specifies a series of connected line primitives with adjacency, with consecutive primitives sharing three vertices. -
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY
specifies a series of separate triangle primitives with adjacency. -
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY
specifies connected triangle primitives with adjacency, with consecutive triangles sharing an edge. -
VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
specifies separate patch primitives.
Each primitive topology, and its construction from a list of vertices, is described in detail below with a supporting diagram, according to the following key:
Vertex |
A point in 3-dimensional space. Positions chosen within the diagrams are arbitrary and for illustration only. |
|
Vertex Number |
Sequence position of a vertex within the provided vertex data. |
|
Provoking Vertex |
Provoking vertex within the main primitive. The tail is angled towards the relevant primitive. Used in flat shading. |
|
Primitive Edge |
An edge connecting the points of a main primitive. |
|
Adjacency Edge |
Points connected by these lines do not contribute to a main primitive, and are only accessible in a geometry shader. |
|
Winding Order |
The relative order in which vertices are defined within a primitive, used in the facing determination. This ordering has no specific start or end point. |
The diagrams are supported with mathematical definitions where the vertices (v) and primitives (p) are numbered starting from 0; v0 is the first vertex in the provided data and p0 is the first primitive in the set of primitives defined by the vertices and topology.
To dynamically set primitive topology, call:
// Provided by VK_VERSION_1_3
void vkCmdSetPrimitiveTopology(
VkCommandBuffer commandBuffer,
VkPrimitiveTopology primitiveTopology);
-
commandBuffer
is the command buffer into which the command will be recorded. -
primitiveTopology
specifies the primitive topology to use for drawing.
This command sets the primitive topology for subsequent drawing commands
when the graphics pipeline is created with
VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
set in
VkPipelineDynamicStateCreateInfo::pDynamicStates
.
Otherwise, this state is specified by the
VkPipelineInputAssemblyStateCreateInfo::topology
value used to
create the currently active pipeline.
-
VUID-vkCmdSetPrimitiveTopology-None-08971
At least one of the following must be true:-
the value of VkApplicationInfo::
apiVersion
used to create the VkInstance parent ofcommandBuffer
is greater than or equal to Version 1.3
-
-
VUID-vkCmdSetPrimitiveTopology-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdSetPrimitiveTopology-primitiveTopology-parameter
primitiveTopology
must be a valid VkPrimitiveTopology value -
VUID-vkCmdSetPrimitiveTopology-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdSetPrimitiveTopology-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Both |
Graphics |
State |
20.1.1. Topology Class
The primitive topologies are grouped into the following topology classes:
Topology Class | Primitive Topology |
---|---|
Point |
|
Line |
|
Triangle |
|
Patch |
|
20.1.2. Point Lists
When the topology is VK_PRIMITIVE_TOPOLOGY_POINT_LIST
, each
consecutive vertex defines a single point primitive, according to the
equation:
-
pi = {vi}
As there is only one vertex, that vertex is the provoking vertex.
The number of primitives generated is equal to vertexCount
.
20.1.3. Line Lists
When the primitive topology is VK_PRIMITIVE_TOPOLOGY_LINE_LIST
, each
consecutive pair of vertices defines a single line primitive, according to
the equation:
-
pi = {v2i, v2i+1}
The number of primitives generated is equal to
⌊vertexCount
/2⌋.
The provoking vertex for pi is v2i.
20.1.4. Line Strips
When the primitive topology is VK_PRIMITIVE_TOPOLOGY_LINE_STRIP
, one
line primitive is defined by each vertex and the following vertex, according
to the equation:
-
pi = {vi, vi+1}
The number of primitives generated is equal to
max(0,vertexCount
-1).
The provoking vertex for pi is vi.
20.1.5. Triangle Lists
When the primitive topology is VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
,
each consecutive set of three vertices defines a single triangle primitive,
according to the equation:
-
pi = {v3i, v3i+1, v3i+2}
The number of primitives generated is equal to
⌊vertexCount
/3⌋.
The provoking vertex for pi is v3i.
20.1.6. Triangle Strips
When the primitive topology is VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP
,
one triangle primitive is defined by each vertex and the two vertices that
follow it, according to the equation:
-
pi = {vi, vi+(1+i%2), vi+(2-i%2)}
The number of primitives generated is equal to
max(0,vertexCount
-2).
The provoking vertex for pi is vi.
Note
The ordering of the vertices in each successive triangle is reversed, so that the winding order is consistent throughout the strip. |
20.1.7. Triangle Fans
When the primitive topology is VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN
,
triangle primitives are defined around a shared common vertex, according to
the equation:
-
pi = {vi+1, vi+2, v0}
The number of primitives generated is equal to
max(0,vertexCount
-2).
The provoking vertex for pi is vi+1.
20.1.8. Line Lists With Adjacency
When the primitive topology is
VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY
, each consecutive set
of four vertices defines a single line primitive with adjacency, according
to the equation:
-
pi = {v4i, v4i+1, v4i+2,v4i+3}
A line primitive is described by the second and third vertices of the total primitive, with the remaining two vertices only accessible in a geometry shader.
The number of primitives generated is equal to
⌊vertexCount
/4⌋.
The provoking vertex for pi is v4i+1.
20.1.9. Line Strips With Adjacency
When the primitive topology is
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY
, one line primitive
with adjacency is defined by each vertex and the following vertex, according
to the equation:
-
pi = {vi, vi+1, vi+2, vi+3}
A line primitive is described by the second and third vertices of the total primitive, with the remaining two vertices only accessible in a geometry shader.
The number of primitives generated is equal to
max(0,vertexCount
-3).
The provoking vertex for pi is vi+1.
20.1.10. Triangle Lists With Adjacency
When the primitive topology is
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY
, each consecutive
set of six vertices defines a single triangle primitive with adjacency,
according to the equations:
-
pi = {v6i, v6i+1, v6i+2, v6i+3, v6i+4, v6i+5}
A triangle primitive is described by the first, third, and fifth vertices of the total primitive, with the remaining three vertices only accessible in a geometry shader.
The number of primitives generated is equal to
⌊vertexCount
/6⌋.
The provoking vertex for pi is v6i.
20.1.11. Triangle Strips With Adjacency
When the primitive topology is
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY
, one triangle
primitive with adjacency is defined by each vertex and the following 5
vertices.
The number of primitives generated, n, is equal to ⌊max(0,
vertexCount
- 4)/2⌋.
If n=1, the primitive is defined as:
-
p = {v0, v1, v2, v5, v4, v3}
If n>1, the total primitive consists of different vertices according to where it is in the strip:
-
pi = {v2i, v2i+1, v2i+2, v2i+6, v2i+4, v2i+3} when i=0
-
pi = {v2i, v2i+3, v2i+4, v2i+6, v2i+2, v2i-2} when i>0, i<n-1, and i%2=1
-
pi = {v2i, v2i-2, v2i+2, v2i+6, v2i+4, v2i+3} when i>0, i<n-1, and i%2=0
-
pi = {v2i, v2i+3, v2i+4, v2i+5, v2i+2, v2i-2} when i=n-1 and i%2=1
-
pi = {v2i, v2i-2, v2i+2, v2i+5, v2i+4, v2i+3} when i=n-1 and i%2=0
A triangle primitive is described by the first, third, and fifth vertices of the total primitive in all cases, with the remaining three vertices only accessible in a geometry shader.
Note
The ordering of the vertices in each successive triangle is altered so that the winding order is consistent throughout the strip. |
The provoking vertex for pi is always v2i.
20.1.12. Patch Lists
When the primitive topology is VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
, each
consecutive set of m vertices defines a single patch primitive,
according to the equation:
-
pi = {vmi, vmi+1, …, vmi+(m-2), vmi+(m-1)}
where m is equal to
VkPipelineTessellationStateCreateInfo::patchControlPoints
.
Patch lists are never passed to vertex post-processing,
and as such no provoking vertex is defined for patch primitives.
The number of primitives generated is equal to
⌊vertexCount
/m⌋.
The vertices comprising a patch have no implied geometry, and are used as inputs to tessellation shaders and the fixed-function tessellator to generate new point, line, or triangle primitives.
20.2. Primitive Order
Primitives generated by drawing commands progress through the stages of the graphics pipeline in primitive order. Primitive order is initially determined in the following way:
-
Submission order determines the initial ordering
-
For indirect drawing commands, the order in which accessed instances of the VkDrawIndirectCommand are stored in
buffer
, from lower indirect buffer addresses to higher addresses. -
If a drawing command includes multiple instances, the order in which instances are executed, from lower numbered instances to higher.
-
The order in which primitives are specified by a drawing command:
-
For non-indexed draws, from vertices with a lower numbered
vertexIndex
to a higher numberedvertexIndex
. -
For indexed draws, vertices sourced from a lower index buffer addresses to higher addresses.
-
Within this order implementations further sort primitives:
-
If tessellation shading is active, by an implementation-dependent order of new primitives generated by tessellation.
-
If geometry shading is active, by the order new primitives are generated by geometry shading.
-
If the polygon mode is not
VK_POLYGON_MODE_FILL
, by an implementation-dependent ordering of the new primitives generated within the original primitive.
Primitive order is later used to define rasterization order, which determines the order in which fragments output results to a framebuffer.
20.3. Programmable Primitive Shading
Once primitives are assembled, they proceed to the vertex shading stage of the pipeline. If the draw includes multiple instances, then the set of primitives is sent to the vertex shading stage multiple times, once for each instance.
It is implementation-dependent whether vertex shading occurs on vertices that are discarded as part of incomplete primitives, but if it does occur then it operates as if they were vertices in complete primitives and such invocations can have side effects.
Vertex shading receives two per-vertex inputs from the primitive assembly
stage - the vertexIndex
and the instanceIndex
.
How these values are generated is defined below, with each command.
Drawing commands fall roughly into two categories:
-
Non-indexed drawing commands present a sequential
vertexIndex
to the vertex shader. The sequential index is generated automatically by the device (see Fixed-Function Vertex Processing for details on both specifying the vertex attributes indexed byvertexIndex
, as well as binding vertex buffers containing those attributes to a command buffer). These commands are: -
Indexed drawing commands read index values from an index buffer and use this to compute the
vertexIndex
value for the vertex shader. These commands are:
To bind an index buffer to a command buffer, call:
// Provided by VK_VERSION_1_0
void vkCmdBindIndexBuffer(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkIndexType indexType);
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer being bound. -
offset
is the starting offset in bytes withinbuffer
used in index buffer address calculations. -
indexType
is a VkIndexType value specifying the size of the indices.
-
VUID-vkCmdBindIndexBuffer-offset-08782
offset
must be less than the size ofbuffer
-
VUID-vkCmdBindIndexBuffer-offset-08783
The sum ofoffset
and the base address of the range ofVkDeviceMemory
object that is backingbuffer
, must be a multiple of the size of the type indicated byindexType
-
VUID-vkCmdBindIndexBuffer-buffer-08784
buffer
must have been created with theVK_BUFFER_USAGE_INDEX_BUFFER_BIT
flag -
VUID-vkCmdBindIndexBuffer-buffer-08785
Ifbuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
-
VUID-vkCmdBindIndexBuffer-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdBindIndexBuffer-buffer-parameter
buffer
must be a valid VkBuffer handle -
VUID-vkCmdBindIndexBuffer-indexType-parameter
indexType
must be a valid VkIndexType value -
VUID-vkCmdBindIndexBuffer-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdBindIndexBuffer-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdBindIndexBuffer-commonparent
Both ofbuffer
, andcommandBuffer
must have been created, allocated, or retrieved from the same VkDevice
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Both |
Graphics |
State |
Possible values of
vkCmdBindIndexBuffer::indexType
, specifying the size of indices,
are:
// Provided by VK_VERSION_1_0
typedef enum VkIndexType {
VK_INDEX_TYPE_UINT16 = 0,
VK_INDEX_TYPE_UINT32 = 1,
} VkIndexType;
-
VK_INDEX_TYPE_UINT16
specifies that indices are 16-bit unsigned integer values. -
VK_INDEX_TYPE_UINT32
specifies that indices are 32-bit unsigned integer values.
The parameters for each drawing command are specified directly in the command or read from buffer memory, depending on the command. Drawing commands that source their parameters from buffer memory are known as indirect drawing commands.
All drawing commands interact with the robustBufferAccess
feature.
To record a non-indexed draw, call:
// Provided by VK_VERSION_1_0
void vkCmdDraw(
VkCommandBuffer commandBuffer,
uint32_t vertexCount,
uint32_t instanceCount,
uint32_t firstVertex,
uint32_t firstInstance);
-
commandBuffer
is the command buffer into which the command is recorded. -
vertexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstVertex
is the index of the first vertex to draw. -
firstInstance
is the instance ID of the first instance to draw.
When the command is executed, primitives are assembled using the current
primitive topology and vertexCount
consecutive vertex indices with the
first vertexIndex
value equal to firstVertex
.
The primitives are drawn instanceCount
times with instanceIndex
starting with firstInstance
and increasing sequentially for each
instance.
The assembled primitives execute the bound graphics pipeline.
-
VUID-vkCmdDraw-magFilter-04553
If a VkSampler created withmagFilter
orminFilter
equal toVK_FILTER_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDraw-mipmapMode-04770
If a VkSampler created withmipmapMode
equal toVK_SAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDraw-None-06479
If a VkImageView is sampled with depth comparison, the image view’s format features must containVK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
-
VUID-vkCmdDraw-None-02691
If a VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
-
VUID-vkCmdDraw-None-07888
If aVK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
-
VUID-vkCmdDraw-OpTypeImage-07027
For any VkImageView being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDraw-OpTypeImage-07028
For any VkImageView being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDraw-OpTypeImage-07029
For any VkBufferView being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDraw-OpTypeImage-07030
Any VkBufferView being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDraw-None-02697
For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDraw-None-02698
For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDraw-maintenance4-06425
If themaintenance4
feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDraw-None-02699
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by a bound shader -
VUID-vkCmdDraw-None-02700
A valid pipeline must be bound to the pipeline bind point used by this command -
VUID-vkCmdDraw-None-02859
There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound -
VUID-vkCmdDraw-None-02702
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
VUID-vkCmdDraw-None-02703
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
VUID-vkCmdDraw-None-02704
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage -
VUID-vkCmdDraw-None-02705
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDraw-None-02706
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDraw-commandBuffer-02707
IfcommandBuffer
is an unprotected command buffer andprotectedNoFault
is not supported, any resource accessed by bound shaders must not be a protected resource -
VUID-vkCmdDraw-None-06550
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions -
VUID-vkCmdDraw-ConstOffset-06551
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands -
VUID-vkCmdDraw-viewType-07752
If a VkImageView is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in Instruction/Sampler/Image View Validation -
VUID-vkCmdDraw-format-07753
If a VkImageView is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match -
VUID-vkCmdDraw-OpImageWrite-08795
If a VkImageView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format -
VUID-vkCmdDraw-OpImageWrite-04469
If a VkBufferView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format -
VUID-vkCmdDraw-None-07288
Any shader invocation executed by this command must terminate -
VUID-vkCmdDraw-renderPass-02684
The current render pass must be compatible with therenderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDraw-subpass-02685
The subpass index of the current render pass must be equal to thesubpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDraw-None-07748
If any shader statically accesses an input attachment, a valid descriptor must be bound to the pipeline via a descriptor set -
VUID-vkCmdDraw-OpTypeImage-07468
If any shader executed by this pipeline accesses anOpTypeImage
variable with aDim
operand ofSubpassData
, it must be decorated with anInputAttachmentIndex
that corresponds to a valid input attachment in the current subpass -
VUID-vkCmdDraw-None-07469
Input attachment views accessed in a subpass must be created with the same VkFormat as the corresponding subpass definition, and be created with a VkImageView that is compatible with the attachment referenced by the subpass'pInputAttachments
[InputAttachmentIndex
] in the currently bound VkFramebuffer as specified by Fragment Input Attachment Compatibility -
VUID-vkCmdDraw-None-06537
Memory backing image subresources used as attachments in the current render pass must not be written in any way other than as an attachment by this command -
VUID-vkCmdDraw-None-09000
If a color attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDraw-None-09001
If a depth attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDraw-None-09002
If a stencil attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDraw-None-06539
If any previously recorded command in the current subpass accessed an image subresource used as an attachment in this subpass in any way other than as an attachment, this command must not write to that image subresource as an attachment -
VUID-vkCmdDraw-None-06886
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the depth aspect, depth writes must be disabled -
VUID-vkCmdDraw-None-06887
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the stencil aspect, both front and backwriteMask
are not zero, and stencil test is enabled, all stencil ops must beVK_STENCIL_OP_KEEP
-
VUID-vkCmdDraw-None-07831
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled then vkCmdSetViewport must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07832
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR
dynamic state enabled then vkCmdSetScissor must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07833
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled then vkCmdSetLineWidth must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07834
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled then vkCmdSetDepthBias must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07835
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled then vkCmdSetBlendConstants must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07836
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then vkCmdSetDepthBounds must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07837
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled then vkCmdSetStencilCompareMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07838
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled then vkCmdSetStencilWriteMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07839
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled then vkCmdSetStencilReference must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-maxMultiviewInstanceIndex-02688
If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
-
VUID-vkCmdDraw-None-07840
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_CULL_MODE
dynamic state enabled then vkCmdSetCullMode must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07841
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_FRONT_FACE
dynamic state enabled then vkCmdSetFrontFace must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07843
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07844
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE
dynamic state enabled then vkCmdSetDepthWriteEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07845
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_COMPARE_OP
dynamic state enabled then vkCmdSetDepthCompareOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07846
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthBoundsTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07847
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_TEST_ENABLE
dynamic state enabled then vkCmdSetStencilTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-07848
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_OP
dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-viewportCount-03417
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, then vkCmdSetViewportWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match theVkPipelineViewportStateCreateInfo
::scissorCount
of the pipeline -
VUID-vkCmdDraw-scissorCount-03418
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, then vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and thescissorCount
parameter ofvkCmdSetScissorWithCount
must match theVkPipelineViewportStateCreateInfo
::viewportCount
of the pipeline -
VUID-vkCmdDraw-viewportCount-03419
If the bound graphics pipeline state was created with both theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
andVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic states enabled then both vkCmdSetViewportWithCount and vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match thescissorCount
parameter ofvkCmdSetScissorWithCount
-
VUID-vkCmdDraw-None-04876
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
dynamic state enabled then vkCmdSetRasterizerDiscardEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-None-04877
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE
dynamic state enabled then vkCmdSetDepthBiasEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-blendEnable-04727
If rasterization is not disabled in the bound graphics pipeline, then for each color attachment in the subpass, if the corresponding image view’s format features do not containVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
, then theblendEnable
member of the corresponding element of thepAttachments
member ofpColorBlendState
must beVK_FALSE
-
VUID-vkCmdDraw-rasterizationSamples-04740
If rasterization is not disabled in the bound graphics pipeline, and neither the
nor theVK_AMD_mixed_attachment_samples
extensions are enabled, thenVK_NV_framebuffer_mixed_samples
rasterizationSamples
for the currently bound graphics pipeline must be the same as the current subpass color and/or depth/stencil attachments -
VUID-vkCmdDraw-imageView-06172
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDraw-imageView-06173
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDraw-imageView-06174
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDraw-imageView-06175
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDraw-imageView-06176
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDraw-imageView-06177
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDraw-viewMask-06178
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::viewMask
equal to VkRenderingInfo::viewMask
-
VUID-vkCmdDraw-colorAttachmentCount-06179
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount
equal to VkRenderingInfo::colorAttachmentCount
-
VUID-vkCmdDraw-colorAttachmentCount-06180
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
not equal to VK_NULL_HANDLE must have been created with a VkFormat equal to the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound graphics pipeline -
VUID-vkCmdDraw-colorAttachmentCount-07616
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
equal to VK_NULL_HANDLE must have the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound pipeline equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDraw-pDepthAttachment-06181
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pDepthAttachment->imageView
-
VUID-vkCmdDraw-pDepthAttachment-07617
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDraw-pStencilAttachment-06182
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pStencilAttachment->imageView
-
VUID-vkCmdDraw-pStencilAttachment-07618
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDraw-pColorAttachments-08963
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound with a fragment shader that statically writes to a color attachment, the color write mask is not zero, color writes are enabled, and the corresponding element of the VkRenderingInfo::pColorAttachments->imageView
was not VK_NULL_HANDLE, then the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDraw-pDepthAttachment-08964
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, depth test is enabled, depth write is enabled, and the VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDraw-pStencilAttachment-08965
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, stencil test is enabled and the VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDraw-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source or destination blend factors for that attachment use the secondary color input, the maximum value ofLocation
for any output attachment statically used in theFragment
Execution
Model
executed by this command must be less thanmaxFragmentDualSrcAttachments
-
VUID-vkCmdDraw-commandBuffer-02712
IfcommandBuffer
is a protected command buffer andprotectedNoFault
is not supported, any resource written to by theVkPipeline
object bound to the pipeline bind point used by this command must not be an unprotected resource -
VUID-vkCmdDraw-commandBuffer-02713
IfcommandBuffer
is a protected command buffer andprotectedNoFault
is not supported, pipeline stages other than the framebuffer-space and compute stages in theVkPipeline
object bound to the pipeline bind point used by this command must not write to any resource
-
VUID-vkCmdDraw-None-04007
All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have either valid or VK_NULL_HANDLE buffers bound -
VUID-vkCmdDraw-None-04008
If thenullDescriptor
feature is not enabled, all vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must not be VK_NULL_HANDLE -
VUID-vkCmdDraw-None-02721
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-vkCmdDraw-None-07842
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then vkCmdSetPrimitiveTopology must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDraw-primitiveTopology-03420
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then theprimitiveTopology
parameter ofvkCmdSetPrimitiveTopology
must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology
state -
VUID-vkCmdDraw-pStrides-04884
If the bound graphics pipeline was created with theVK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT
dynamic state enabled, thenvkCmdBindVertexBuffers2EXT
must have been called in the current command buffer prior to this drawing command, and thepStrides
parameter ofvkCmdBindVertexBuffers2EXT
must not beNULL
-
VUID-vkCmdDraw-None-04879
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
dynamic state enabled then vkCmdSetPrimitiveRestartEnable must have been called in the current command buffer prior to this drawing command
-
VUID-vkCmdDraw-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdDraw-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdDraw-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdDraw-renderpass
This command must only be called inside of a render pass instance
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Inside |
Graphics |
Action |
To record an indexed draw, call:
// Provided by VK_VERSION_1_0
void vkCmdDrawIndexed(
VkCommandBuffer commandBuffer,
uint32_t indexCount,
uint32_t instanceCount,
uint32_t firstIndex,
int32_t vertexOffset,
uint32_t firstInstance);
-
commandBuffer
is the command buffer into which the command is recorded. -
indexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstIndex
is the base index within the index buffer. -
vertexOffset
is the value added to the vertex index before indexing into the vertex buffer. -
firstInstance
is the instance ID of the first instance to draw.
When the command is executed, primitives are assembled using the current
primitive topology and indexCount
vertices whose indices are retrieved
from the index buffer.
The index buffer is treated as an array of tightly packed unsigned integers
of size defined by the
vkCmdBindIndexBuffer::indexType
parameter with which the buffer
was bound.
The first vertex index is at an offset of firstIndex
×
indexSize
+ offset
within the bound index buffer, where
offset
is the offset specified by vkCmdBindIndexBuffer
and indexSize
is the byte size of the type specified by
indexType
.
Subsequent index values are retrieved from consecutive locations in the
index buffer.
Indices are first compared to the primitive restart value, then zero
extended to 32 bits (if the indexType
is
VK_INDEX_TYPE_UINT16
) and have vertexOffset
added to them,
before being supplied as the vertexIndex
value.
The primitives are drawn instanceCount
times with instanceIndex
starting with firstInstance
and increasing sequentially for each
instance.
The assembled primitives execute the bound graphics pipeline.
-
VUID-vkCmdDrawIndexed-magFilter-04553
If a VkSampler created withmagFilter
orminFilter
equal toVK_FILTER_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndexed-mipmapMode-04770
If a VkSampler created withmipmapMode
equal toVK_SAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndexed-None-06479
If a VkImageView is sampled with depth comparison, the image view’s format features must containVK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
-
VUID-vkCmdDrawIndexed-None-02691
If a VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
-
VUID-vkCmdDrawIndexed-None-07888
If aVK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
-
VUID-vkCmdDrawIndexed-OpTypeImage-07027
For any VkImageView being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexed-OpTypeImage-07028
For any VkImageView being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexed-OpTypeImage-07029
For any VkBufferView being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexed-OpTypeImage-07030
Any VkBufferView being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexed-None-02697
For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexed-None-02698
For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexed-maintenance4-06425
If themaintenance4
feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexed-None-02699
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by a bound shader -
VUID-vkCmdDrawIndexed-None-02700
A valid pipeline must be bound to the pipeline bind point used by this command -
VUID-vkCmdDrawIndexed-None-02859
There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound -
VUID-vkCmdDrawIndexed-None-02702
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
VUID-vkCmdDrawIndexed-None-02703
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
VUID-vkCmdDrawIndexed-None-02704
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage -
VUID-vkCmdDrawIndexed-None-02705
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndexed-None-02706
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndexed-commandBuffer-02707
IfcommandBuffer
is an unprotected command buffer andprotectedNoFault
is not supported, any resource accessed by bound shaders must not be a protected resource -
VUID-vkCmdDrawIndexed-None-06550
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions -
VUID-vkCmdDrawIndexed-ConstOffset-06551
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands -
VUID-vkCmdDrawIndexed-viewType-07752
If a VkImageView is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in Instruction/Sampler/Image View Validation -
VUID-vkCmdDrawIndexed-format-07753
If a VkImageView is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match -
VUID-vkCmdDrawIndexed-OpImageWrite-08795
If a VkImageView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format -
VUID-vkCmdDrawIndexed-OpImageWrite-04469
If a VkBufferView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format -
VUID-vkCmdDrawIndexed-None-07288
Any shader invocation executed by this command must terminate -
VUID-vkCmdDrawIndexed-renderPass-02684
The current render pass must be compatible with therenderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndexed-subpass-02685
The subpass index of the current render pass must be equal to thesubpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndexed-None-07748
If any shader statically accesses an input attachment, a valid descriptor must be bound to the pipeline via a descriptor set -
VUID-vkCmdDrawIndexed-OpTypeImage-07468
If any shader executed by this pipeline accesses anOpTypeImage
variable with aDim
operand ofSubpassData
, it must be decorated with anInputAttachmentIndex
that corresponds to a valid input attachment in the current subpass -
VUID-vkCmdDrawIndexed-None-07469
Input attachment views accessed in a subpass must be created with the same VkFormat as the corresponding subpass definition, and be created with a VkImageView that is compatible with the attachment referenced by the subpass'pInputAttachments
[InputAttachmentIndex
] in the currently bound VkFramebuffer as specified by Fragment Input Attachment Compatibility -
VUID-vkCmdDrawIndexed-None-06537
Memory backing image subresources used as attachments in the current render pass must not be written in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexed-None-09000
If a color attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexed-None-09001
If a depth attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexed-None-09002
If a stencil attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexed-None-06539
If any previously recorded command in the current subpass accessed an image subresource used as an attachment in this subpass in any way other than as an attachment, this command must not write to that image subresource as an attachment -
VUID-vkCmdDrawIndexed-None-06886
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the depth aspect, depth writes must be disabled -
VUID-vkCmdDrawIndexed-None-06887
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the stencil aspect, both front and backwriteMask
are not zero, and stencil test is enabled, all stencil ops must beVK_STENCIL_OP_KEEP
-
VUID-vkCmdDrawIndexed-None-07831
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled then vkCmdSetViewport must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07832
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR
dynamic state enabled then vkCmdSetScissor must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07833
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled then vkCmdSetLineWidth must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07834
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled then vkCmdSetDepthBias must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07835
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled then vkCmdSetBlendConstants must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07836
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then vkCmdSetDepthBounds must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07837
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled then vkCmdSetStencilCompareMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07838
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled then vkCmdSetStencilWriteMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07839
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled then vkCmdSetStencilReference must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-02688
If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
-
VUID-vkCmdDrawIndexed-None-07840
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_CULL_MODE
dynamic state enabled then vkCmdSetCullMode must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07841
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_FRONT_FACE
dynamic state enabled then vkCmdSetFrontFace must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07843
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07844
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE
dynamic state enabled then vkCmdSetDepthWriteEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07845
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_COMPARE_OP
dynamic state enabled then vkCmdSetDepthCompareOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07846
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthBoundsTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07847
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_TEST_ENABLE
dynamic state enabled then vkCmdSetStencilTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-07848
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_OP
dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-viewportCount-03417
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, then vkCmdSetViewportWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match theVkPipelineViewportStateCreateInfo
::scissorCount
of the pipeline -
VUID-vkCmdDrawIndexed-scissorCount-03418
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, then vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and thescissorCount
parameter ofvkCmdSetScissorWithCount
must match theVkPipelineViewportStateCreateInfo
::viewportCount
of the pipeline -
VUID-vkCmdDrawIndexed-viewportCount-03419
If the bound graphics pipeline state was created with both theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
andVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic states enabled then both vkCmdSetViewportWithCount and vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match thescissorCount
parameter ofvkCmdSetScissorWithCount
-
VUID-vkCmdDrawIndexed-None-04876
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
dynamic state enabled then vkCmdSetRasterizerDiscardEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-None-04877
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE
dynamic state enabled then vkCmdSetDepthBiasEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-blendEnable-04727
If rasterization is not disabled in the bound graphics pipeline, then for each color attachment in the subpass, if the corresponding image view’s format features do not containVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
, then theblendEnable
member of the corresponding element of thepAttachments
member ofpColorBlendState
must beVK_FALSE
-
VUID-vkCmdDrawIndexed-rasterizationSamples-04740
If rasterization is not disabled in the bound graphics pipeline, and neither the
nor theVK_AMD_mixed_attachment_samples
extensions are enabled, thenVK_NV_framebuffer_mixed_samples
rasterizationSamples
for the currently bound graphics pipeline must be the same as the current subpass color and/or depth/stencil attachments -
VUID-vkCmdDrawIndexed-imageView-06172
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexed-imageView-06173
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexed-imageView-06174
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexed-imageView-06175
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexed-imageView-06176
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexed-imageView-06177
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexed-viewMask-06178
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::viewMask
equal to VkRenderingInfo::viewMask
-
VUID-vkCmdDrawIndexed-colorAttachmentCount-06179
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount
equal to VkRenderingInfo::colorAttachmentCount
-
VUID-vkCmdDrawIndexed-colorAttachmentCount-06180
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
not equal to VK_NULL_HANDLE must have been created with a VkFormat equal to the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound graphics pipeline -
VUID-vkCmdDrawIndexed-colorAttachmentCount-07616
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
equal to VK_NULL_HANDLE must have the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound pipeline equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexed-pDepthAttachment-06181
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pDepthAttachment->imageView
-
VUID-vkCmdDrawIndexed-pDepthAttachment-07617
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexed-pStencilAttachment-06182
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pStencilAttachment->imageView
-
VUID-vkCmdDrawIndexed-pStencilAttachment-07618
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexed-pColorAttachments-08963
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound with a fragment shader that statically writes to a color attachment, the color write mask is not zero, color writes are enabled, and the corresponding element of the VkRenderingInfo::pColorAttachments->imageView
was not VK_NULL_HANDLE, then the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexed-pDepthAttachment-08964
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, depth test is enabled, depth write is enabled, and the VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexed-pStencilAttachment-08965
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, stencil test is enabled and the VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexed-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source or destination blend factors for that attachment use the secondary color input, the maximum value ofLocation
for any output attachment statically used in theFragment
Execution
Model
executed by this command must be less thanmaxFragmentDualSrcAttachments
-
VUID-vkCmdDrawIndexed-commandBuffer-02712
IfcommandBuffer
is a protected command buffer andprotectedNoFault
is not supported, any resource written to by theVkPipeline
object bound to the pipeline bind point used by this command must not be an unprotected resource -
VUID-vkCmdDrawIndexed-commandBuffer-02713
IfcommandBuffer
is a protected command buffer andprotectedNoFault
is not supported, pipeline stages other than the framebuffer-space and compute stages in theVkPipeline
object bound to the pipeline bind point used by this command must not write to any resource
-
VUID-vkCmdDrawIndexed-None-04007
All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have either valid or VK_NULL_HANDLE buffers bound -
VUID-vkCmdDrawIndexed-None-04008
If thenullDescriptor
feature is not enabled, all vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must not be VK_NULL_HANDLE -
VUID-vkCmdDrawIndexed-None-02721
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-vkCmdDrawIndexed-None-07842
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then vkCmdSetPrimitiveTopology must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexed-primitiveTopology-03420
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then theprimitiveTopology
parameter ofvkCmdSetPrimitiveTopology
must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology
state -
VUID-vkCmdDrawIndexed-pStrides-04884
If the bound graphics pipeline was created with theVK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT
dynamic state enabled, thenvkCmdBindVertexBuffers2EXT
must have been called in the current command buffer prior to this drawing command, and thepStrides
parameter ofvkCmdBindVertexBuffers2EXT
must not beNULL
-
VUID-vkCmdDrawIndexed-None-04879
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
dynamic state enabled then vkCmdSetPrimitiveRestartEnable must have been called in the current command buffer prior to this drawing command
-
VUID-vkCmdDrawIndexed-None-07312
An index buffer must be bound -
VUID-vkCmdDrawIndexed-robustBufferAccess2-07825
IfrobustBufferAccess2
is not enabled, (indexSize
× (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the bound index buffer, withindexSize
being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
-
VUID-vkCmdDrawIndexed-robustBufferAccess2-08797
IfrobustBufferAccess2
is not enabled, (indexSize
× (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the bound index buffer, withindexSize
being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
-
VUID-vkCmdDrawIndexed-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdDrawIndexed-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdDrawIndexed-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdDrawIndexed-renderpass
This command must only be called inside of a render pass instance
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Inside |
Graphics |
Action |
To record a non-indexed indirect drawing command, call:
// Provided by VK_VERSION_1_0
void vkCmdDrawIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride);
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer containing draw parameters. -
offset
is the byte offset intobuffer
where parameters begin. -
drawCount
is the number of draws to execute, and can be zero. -
stride
is the byte stride between successive sets of draw parameters.
vkCmdDrawIndirect
behaves similarly to vkCmdDraw except that the
parameters are read by the device from a buffer during execution.
drawCount
draws are executed by the command, with parameters taken
from buffer
starting at offset
and increasing by stride
bytes for each successive draw.
The parameters of each draw are encoded in an array of
VkDrawIndirectCommand structures.
If drawCount
is less than or equal to one, stride
is ignored.
-
VUID-vkCmdDrawIndirect-magFilter-04553
If a VkSampler created withmagFilter
orminFilter
equal toVK_FILTER_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndirect-mipmapMode-04770
If a VkSampler created withmipmapMode
equal toVK_SAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndirect-None-06479
If a VkImageView is sampled with depth comparison, the image view’s format features must containVK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
-
VUID-vkCmdDrawIndirect-None-02691
If a VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
-
VUID-vkCmdDrawIndirect-None-07888
If aVK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
-
VUID-vkCmdDrawIndirect-OpTypeImage-07027
For any VkImageView being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirect-OpTypeImage-07028
For any VkImageView being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirect-OpTypeImage-07029
For any VkBufferView being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirect-OpTypeImage-07030
Any VkBufferView being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirect-None-02697
For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndirect-None-02698
For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndirect-maintenance4-06425
If themaintenance4
feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndirect-None-02699
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by a bound shader -
VUID-vkCmdDrawIndirect-None-02700
A valid pipeline must be bound to the pipeline bind point used by this command -
VUID-vkCmdDrawIndirect-None-02859
There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound -
VUID-vkCmdDrawIndirect-None-02702
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
VUID-vkCmdDrawIndirect-None-02703
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
VUID-vkCmdDrawIndirect-None-02704
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage -
VUID-vkCmdDrawIndirect-None-02705
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndirect-None-02706
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndirect-commandBuffer-02707
IfcommandBuffer
is an unprotected command buffer andprotectedNoFault
is not supported, any resource accessed by bound shaders must not be a protected resource -
VUID-vkCmdDrawIndirect-None-06550
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions -
VUID-vkCmdDrawIndirect-ConstOffset-06551
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands -
VUID-vkCmdDrawIndirect-viewType-07752
If a VkImageView is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in Instruction/Sampler/Image View Validation -
VUID-vkCmdDrawIndirect-format-07753
If a VkImageView is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match -
VUID-vkCmdDrawIndirect-OpImageWrite-08795
If a VkImageView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format -
VUID-vkCmdDrawIndirect-OpImageWrite-04469
If a VkBufferView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format -
VUID-vkCmdDrawIndirect-None-07288
Any shader invocation executed by this command must terminate -
VUID-vkCmdDrawIndirect-renderPass-02684
The current render pass must be compatible with therenderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndirect-subpass-02685
The subpass index of the current render pass must be equal to thesubpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndirect-None-07748
If any shader statically accesses an input attachment, a valid descriptor must be bound to the pipeline via a descriptor set -
VUID-vkCmdDrawIndirect-OpTypeImage-07468
If any shader executed by this pipeline accesses anOpTypeImage
variable with aDim
operand ofSubpassData
, it must be decorated with anInputAttachmentIndex
that corresponds to a valid input attachment in the current subpass -
VUID-vkCmdDrawIndirect-None-07469
Input attachment views accessed in a subpass must be created with the same VkFormat as the corresponding subpass definition, and be created with a VkImageView that is compatible with the attachment referenced by the subpass'pInputAttachments
[InputAttachmentIndex
] in the currently bound VkFramebuffer as specified by Fragment Input Attachment Compatibility -
VUID-vkCmdDrawIndirect-None-06537
Memory backing image subresources used as attachments in the current render pass must not be written in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirect-None-09000
If a color attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirect-None-09001
If a depth attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirect-None-09002
If a stencil attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirect-None-06539
If any previously recorded command in the current subpass accessed an image subresource used as an attachment in this subpass in any way other than as an attachment, this command must not write to that image subresource as an attachment -
VUID-vkCmdDrawIndirect-None-06886
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the depth aspect, depth writes must be disabled -
VUID-vkCmdDrawIndirect-None-06887
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the stencil aspect, both front and backwriteMask
are not zero, and stencil test is enabled, all stencil ops must beVK_STENCIL_OP_KEEP
-
VUID-vkCmdDrawIndirect-None-07831
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled then vkCmdSetViewport must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07832
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR
dynamic state enabled then vkCmdSetScissor must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07833
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled then vkCmdSetLineWidth must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07834
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled then vkCmdSetDepthBias must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07835
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled then vkCmdSetBlendConstants must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07836
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then vkCmdSetDepthBounds must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07837
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled then vkCmdSetStencilCompareMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07838
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled then vkCmdSetStencilWriteMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07839
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled then vkCmdSetStencilReference must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-02688
If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
-
VUID-vkCmdDrawIndirect-None-07840
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_CULL_MODE
dynamic state enabled then vkCmdSetCullMode must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07841
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_FRONT_FACE
dynamic state enabled then vkCmdSetFrontFace must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07843
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07844
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE
dynamic state enabled then vkCmdSetDepthWriteEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07845
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_COMPARE_OP
dynamic state enabled then vkCmdSetDepthCompareOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07846
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthBoundsTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07847
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_TEST_ENABLE
dynamic state enabled then vkCmdSetStencilTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-07848
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_OP
dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-viewportCount-03417
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, then vkCmdSetViewportWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match theVkPipelineViewportStateCreateInfo
::scissorCount
of the pipeline -
VUID-vkCmdDrawIndirect-scissorCount-03418
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, then vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and thescissorCount
parameter ofvkCmdSetScissorWithCount
must match theVkPipelineViewportStateCreateInfo
::viewportCount
of the pipeline -
VUID-vkCmdDrawIndirect-viewportCount-03419
If the bound graphics pipeline state was created with both theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
andVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic states enabled then both vkCmdSetViewportWithCount and vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match thescissorCount
parameter ofvkCmdSetScissorWithCount
-
VUID-vkCmdDrawIndirect-None-04876
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
dynamic state enabled then vkCmdSetRasterizerDiscardEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-None-04877
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE
dynamic state enabled then vkCmdSetDepthBiasEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-blendEnable-04727
If rasterization is not disabled in the bound graphics pipeline, then for each color attachment in the subpass, if the corresponding image view’s format features do not containVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
, then theblendEnable
member of the corresponding element of thepAttachments
member ofpColorBlendState
must beVK_FALSE
-
VUID-vkCmdDrawIndirect-rasterizationSamples-04740
If rasterization is not disabled in the bound graphics pipeline, and neither the
nor theVK_AMD_mixed_attachment_samples
extensions are enabled, thenVK_NV_framebuffer_mixed_samples
rasterizationSamples
for the currently bound graphics pipeline must be the same as the current subpass color and/or depth/stencil attachments -
VUID-vkCmdDrawIndirect-imageView-06172
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndirect-imageView-06173
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndirect-imageView-06174
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndirect-imageView-06175
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndirect-imageView-06176
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndirect-imageView-06177
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndirect-viewMask-06178
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::viewMask
equal to VkRenderingInfo::viewMask
-
VUID-vkCmdDrawIndirect-colorAttachmentCount-06179
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount
equal to VkRenderingInfo::colorAttachmentCount
-
VUID-vkCmdDrawIndirect-colorAttachmentCount-06180
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
not equal to VK_NULL_HANDLE must have been created with a VkFormat equal to the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound graphics pipeline -
VUID-vkCmdDrawIndirect-colorAttachmentCount-07616
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
equal to VK_NULL_HANDLE must have the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound pipeline equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirect-pDepthAttachment-06181
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pDepthAttachment->imageView
-
VUID-vkCmdDrawIndirect-pDepthAttachment-07617
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirect-pStencilAttachment-06182
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pStencilAttachment->imageView
-
VUID-vkCmdDrawIndirect-pStencilAttachment-07618
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirect-pColorAttachments-08963
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound with a fragment shader that statically writes to a color attachment, the color write mask is not zero, color writes are enabled, and the corresponding element of the VkRenderingInfo::pColorAttachments->imageView
was not VK_NULL_HANDLE, then the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirect-pDepthAttachment-08964
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, depth test is enabled, depth write is enabled, and the VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirect-pStencilAttachment-08965
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, stencil test is enabled and the VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirect-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source or destination blend factors for that attachment use the secondary color input, the maximum value ofLocation
for any output attachment statically used in theFragment
Execution
Model
executed by this command must be less thanmaxFragmentDualSrcAttachments
-
VUID-vkCmdDrawIndirect-None-04007
All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have either valid or VK_NULL_HANDLE buffers bound -
VUID-vkCmdDrawIndirect-None-04008
If thenullDescriptor
feature is not enabled, all vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must not be VK_NULL_HANDLE -
VUID-vkCmdDrawIndirect-None-02721
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-vkCmdDrawIndirect-None-07842
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then vkCmdSetPrimitiveTopology must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirect-primitiveTopology-03420
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then theprimitiveTopology
parameter ofvkCmdSetPrimitiveTopology
must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology
state -
VUID-vkCmdDrawIndirect-pStrides-04884
If the bound graphics pipeline was created with theVK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT
dynamic state enabled, thenvkCmdBindVertexBuffers2EXT
must have been called in the current command buffer prior to this drawing command, and thepStrides
parameter ofvkCmdBindVertexBuffers2EXT
must not beNULL
-
VUID-vkCmdDrawIndirect-None-04879
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
dynamic state enabled then vkCmdSetPrimitiveRestartEnable must have been called in the current command buffer prior to this drawing command
-
VUID-vkCmdDrawIndirect-buffer-02708
Ifbuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-vkCmdDrawIndirect-buffer-02709
buffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdDrawIndirect-offset-02710
offset
must be a multiple of4
-
VUID-vkCmdDrawIndirect-commandBuffer-02711
commandBuffer
must not be a protected command buffer
-
VUID-vkCmdDrawIndirect-drawCount-02718
If themultiDrawIndirect
feature is not enabled,drawCount
must be0
or1
-
VUID-vkCmdDrawIndirect-drawCount-02719
drawCount
must be less than or equal toVkPhysicalDeviceLimits
::maxDrawIndirectCount
-
VUID-vkCmdDrawIndirect-drawCount-00476
IfdrawCount
is greater than1
,stride
must be a multiple of4
and must be greater than or equal tosizeof
(VkDrawIndirectCommand
) -
VUID-vkCmdDrawIndirect-drawCount-00487
IfdrawCount
is equal to1
, (offset
+sizeof
(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndirect-drawCount-00488
IfdrawCount
is greater than1
, (stride
× (drawCount
- 1) +offset
+sizeof
(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndirect-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdDrawIndirect-buffer-parameter
buffer
must be a valid VkBuffer handle -
VUID-vkCmdDrawIndirect-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdDrawIndirect-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdDrawIndirect-renderpass
This command must only be called inside of a render pass instance -
VUID-vkCmdDrawIndirect-commonparent
Both ofbuffer
, andcommandBuffer
must have been created, allocated, or retrieved from the same VkDevice
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Inside |
Graphics |
Action |
The VkDrawIndirectCommand
structure is defined as:
// Provided by VK_VERSION_1_0
typedef struct VkDrawIndirectCommand {
uint32_t vertexCount;
uint32_t instanceCount;
uint32_t firstVertex;
uint32_t firstInstance;
} VkDrawIndirectCommand;
-
vertexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstVertex
is the index of the first vertex to draw. -
firstInstance
is the instance ID of the first instance to draw.
The members of VkDrawIndirectCommand
have the same meaning as the
similarly named parameters of vkCmdDraw.
-
VUID-VkDrawIndirectCommand-None-00500
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-VkDrawIndirectCommand-firstInstance-00501
If thedrawIndirectFirstInstance
feature is not enabled,firstInstance
must be0
To record a non-indexed draw call with a draw call count sourced from a buffer, call:
// Provided by VK_VERSION_1_2
void vkCmdDrawIndirectCount(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkBuffer countBuffer,
VkDeviceSize countBufferOffset,
uint32_t maxDrawCount,
uint32_t stride);
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer containing draw parameters. -
offset
is the byte offset intobuffer
where parameters begin. -
countBuffer
is the buffer containing the draw count. -
countBufferOffset
is the byte offset intocountBuffer
where the draw count begins. -
maxDrawCount
specifies the maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified incountBuffer
andmaxDrawCount
. -
stride
is the byte stride between successive sets of draw parameters.
vkCmdDrawIndirectCount
behaves similarly to vkCmdDrawIndirect
except that the draw count is read by the device from a buffer during
execution.
The command will read an unsigned 32-bit integer from countBuffer
located at countBufferOffset
and use this as the draw count.
-
VUID-vkCmdDrawIndirectCount-magFilter-04553
If a VkSampler created withmagFilter
orminFilter
equal toVK_FILTER_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndirectCount-mipmapMode-04770
If a VkSampler created withmipmapMode
equal toVK_SAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndirectCount-None-06479
If a VkImageView is sampled with depth comparison, the image view’s format features must containVK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
-
VUID-vkCmdDrawIndirectCount-None-02691
If a VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
-
VUID-vkCmdDrawIndirectCount-None-07888
If aVK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
-
VUID-vkCmdDrawIndirectCount-OpTypeImage-07027
For any VkImageView being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirectCount-OpTypeImage-07028
For any VkImageView being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirectCount-OpTypeImage-07029
For any VkBufferView being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirectCount-OpTypeImage-07030
Any VkBufferView being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndirectCount-None-02697
For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndirectCount-None-02698
For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndirectCount-maintenance4-06425
If themaintenance4
feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndirectCount-None-02699
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by a bound shader -
VUID-vkCmdDrawIndirectCount-None-02700
A valid pipeline must be bound to the pipeline bind point used by this command -
VUID-vkCmdDrawIndirectCount-None-02859
There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound -
VUID-vkCmdDrawIndirectCount-None-02702
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
VUID-vkCmdDrawIndirectCount-None-02703
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
VUID-vkCmdDrawIndirectCount-None-02704
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage -
VUID-vkCmdDrawIndirectCount-None-02705
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndirectCount-None-02706
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndirectCount-commandBuffer-02707
IfcommandBuffer
is an unprotected command buffer andprotectedNoFault
is not supported, any resource accessed by bound shaders must not be a protected resource -
VUID-vkCmdDrawIndirectCount-None-06550
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions -
VUID-vkCmdDrawIndirectCount-ConstOffset-06551
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands -
VUID-vkCmdDrawIndirectCount-viewType-07752
If a VkImageView is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in Instruction/Sampler/Image View Validation -
VUID-vkCmdDrawIndirectCount-format-07753
If a VkImageView is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match -
VUID-vkCmdDrawIndirectCount-OpImageWrite-08795
If a VkImageView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format -
VUID-vkCmdDrawIndirectCount-OpImageWrite-04469
If a VkBufferView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format -
VUID-vkCmdDrawIndirectCount-None-07288
Any shader invocation executed by this command must terminate -
VUID-vkCmdDrawIndirectCount-renderPass-02684
The current render pass must be compatible with therenderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndirectCount-subpass-02685
The subpass index of the current render pass must be equal to thesubpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndirectCount-None-07748
If any shader statically accesses an input attachment, a valid descriptor must be bound to the pipeline via a descriptor set -
VUID-vkCmdDrawIndirectCount-OpTypeImage-07468
If any shader executed by this pipeline accesses anOpTypeImage
variable with aDim
operand ofSubpassData
, it must be decorated with anInputAttachmentIndex
that corresponds to a valid input attachment in the current subpass -
VUID-vkCmdDrawIndirectCount-None-07469
Input attachment views accessed in a subpass must be created with the same VkFormat as the corresponding subpass definition, and be created with a VkImageView that is compatible with the attachment referenced by the subpass'pInputAttachments
[InputAttachmentIndex
] in the currently bound VkFramebuffer as specified by Fragment Input Attachment Compatibility -
VUID-vkCmdDrawIndirectCount-None-06537
Memory backing image subresources used as attachments in the current render pass must not be written in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirectCount-None-09000
If a color attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirectCount-None-09001
If a depth attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirectCount-None-09002
If a stencil attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndirectCount-None-06539
If any previously recorded command in the current subpass accessed an image subresource used as an attachment in this subpass in any way other than as an attachment, this command must not write to that image subresource as an attachment -
VUID-vkCmdDrawIndirectCount-None-06886
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the depth aspect, depth writes must be disabled -
VUID-vkCmdDrawIndirectCount-None-06887
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the stencil aspect, both front and backwriteMask
are not zero, and stencil test is enabled, all stencil ops must beVK_STENCIL_OP_KEEP
-
VUID-vkCmdDrawIndirectCount-None-07831
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled then vkCmdSetViewport must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07832
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR
dynamic state enabled then vkCmdSetScissor must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07833
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled then vkCmdSetLineWidth must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07834
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled then vkCmdSetDepthBias must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07835
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled then vkCmdSetBlendConstants must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07836
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then vkCmdSetDepthBounds must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07837
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled then vkCmdSetStencilCompareMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07838
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled then vkCmdSetStencilWriteMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07839
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled then vkCmdSetStencilReference must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-maxMultiviewInstanceIndex-02688
If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
-
VUID-vkCmdDrawIndirectCount-None-07840
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_CULL_MODE
dynamic state enabled then vkCmdSetCullMode must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07841
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_FRONT_FACE
dynamic state enabled then vkCmdSetFrontFace must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07843
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07844
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE
dynamic state enabled then vkCmdSetDepthWriteEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07845
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_COMPARE_OP
dynamic state enabled then vkCmdSetDepthCompareOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07846
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthBoundsTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07847
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_TEST_ENABLE
dynamic state enabled then vkCmdSetStencilTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-07848
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_OP
dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-viewportCount-03417
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, then vkCmdSetViewportWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match theVkPipelineViewportStateCreateInfo
::scissorCount
of the pipeline -
VUID-vkCmdDrawIndirectCount-scissorCount-03418
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, then vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and thescissorCount
parameter ofvkCmdSetScissorWithCount
must match theVkPipelineViewportStateCreateInfo
::viewportCount
of the pipeline -
VUID-vkCmdDrawIndirectCount-viewportCount-03419
If the bound graphics pipeline state was created with both theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
andVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic states enabled then both vkCmdSetViewportWithCount and vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match thescissorCount
parameter ofvkCmdSetScissorWithCount
-
VUID-vkCmdDrawIndirectCount-None-04876
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
dynamic state enabled then vkCmdSetRasterizerDiscardEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-None-04877
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE
dynamic state enabled then vkCmdSetDepthBiasEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-blendEnable-04727
If rasterization is not disabled in the bound graphics pipeline, then for each color attachment in the subpass, if the corresponding image view’s format features do not containVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
, then theblendEnable
member of the corresponding element of thepAttachments
member ofpColorBlendState
must beVK_FALSE
-
VUID-vkCmdDrawIndirectCount-rasterizationSamples-04740
If rasterization is not disabled in the bound graphics pipeline, and neither the
nor theVK_AMD_mixed_attachment_samples
extensions are enabled, thenVK_NV_framebuffer_mixed_samples
rasterizationSamples
for the currently bound graphics pipeline must be the same as the current subpass color and/or depth/stencil attachments -
VUID-vkCmdDrawIndirectCount-imageView-06172
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndirectCount-imageView-06173
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndirectCount-imageView-06174
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndirectCount-imageView-06175
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndirectCount-imageView-06176
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndirectCount-imageView-06177
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndirectCount-viewMask-06178
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::viewMask
equal to VkRenderingInfo::viewMask
-
VUID-vkCmdDrawIndirectCount-colorAttachmentCount-06179
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount
equal to VkRenderingInfo::colorAttachmentCount
-
VUID-vkCmdDrawIndirectCount-colorAttachmentCount-06180
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
not equal to VK_NULL_HANDLE must have been created with a VkFormat equal to the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound graphics pipeline -
VUID-vkCmdDrawIndirectCount-colorAttachmentCount-07616
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
equal to VK_NULL_HANDLE must have the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound pipeline equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirectCount-pDepthAttachment-06181
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pDepthAttachment->imageView
-
VUID-vkCmdDrawIndirectCount-pDepthAttachment-07617
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirectCount-pStencilAttachment-06182
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pStencilAttachment->imageView
-
VUID-vkCmdDrawIndirectCount-pStencilAttachment-07618
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirectCount-pColorAttachments-08963
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound with a fragment shader that statically writes to a color attachment, the color write mask is not zero, color writes are enabled, and the corresponding element of the VkRenderingInfo::pColorAttachments->imageView
was not VK_NULL_HANDLE, then the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirectCount-pDepthAttachment-08964
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, depth test is enabled, depth write is enabled, and the VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirectCount-pStencilAttachment-08965
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, stencil test is enabled and the VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndirectCount-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source or destination blend factors for that attachment use the secondary color input, the maximum value ofLocation
for any output attachment statically used in theFragment
Execution
Model
executed by this command must be less thanmaxFragmentDualSrcAttachments
-
VUID-vkCmdDrawIndirectCount-None-04007
All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have either valid or VK_NULL_HANDLE buffers bound -
VUID-vkCmdDrawIndirectCount-None-04008
If thenullDescriptor
feature is not enabled, all vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must not be VK_NULL_HANDLE -
VUID-vkCmdDrawIndirectCount-None-02721
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-vkCmdDrawIndirectCount-None-07842
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then vkCmdSetPrimitiveTopology must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndirectCount-primitiveTopology-03420
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then theprimitiveTopology
parameter ofvkCmdSetPrimitiveTopology
must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology
state -
VUID-vkCmdDrawIndirectCount-pStrides-04884
If the bound graphics pipeline was created with theVK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT
dynamic state enabled, thenvkCmdBindVertexBuffers2EXT
must have been called in the current command buffer prior to this drawing command, and thepStrides
parameter ofvkCmdBindVertexBuffers2EXT
must not beNULL
-
VUID-vkCmdDrawIndirectCount-None-04879
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
dynamic state enabled then vkCmdSetPrimitiveRestartEnable must have been called in the current command buffer prior to this drawing command
-
VUID-vkCmdDrawIndirectCount-buffer-02708
Ifbuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-vkCmdDrawIndirectCount-buffer-02709
buffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdDrawIndirectCount-offset-02710
offset
must be a multiple of4
-
VUID-vkCmdDrawIndirectCount-commandBuffer-02711
commandBuffer
must not be a protected command buffer
-
VUID-vkCmdDrawIndirectCount-countBuffer-02714
IfcountBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-vkCmdDrawIndirectCount-countBuffer-02715
countBuffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdDrawIndirectCount-countBufferOffset-02716
countBufferOffset
must be a multiple of4
-
VUID-vkCmdDrawIndirectCount-countBuffer-02717
The count stored incountBuffer
must be less than or equal toVkPhysicalDeviceLimits
::maxDrawIndirectCount
-
VUID-vkCmdDrawIndirectCount-countBufferOffset-04129
(countBufferOffset
+sizeof
(uint32_t)) must be less than or equal to the size ofcountBuffer
-
VUID-vkCmdDrawIndirectCount-None-04445
IfdrawIndirectCount
is not enabled this function must not be used -
VUID-vkCmdDrawIndirectCount-stride-03110
stride
must be a multiple of4
and must be greater than or equal to sizeof(VkDrawIndirectCommand
) -
VUID-vkCmdDrawIndirectCount-maxDrawCount-03111
IfmaxDrawCount
is greater than or equal to1
, (stride
× (maxDrawCount
- 1) +offset
+ sizeof(VkDrawIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndirectCount-countBuffer-03121
If the count stored incountBuffer
is equal to1
, (offset
+ sizeof(VkDrawIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndirectCount-countBuffer-03122
If the count stored incountBuffer
is greater than1
, (stride
× (drawCount
- 1) +offset
+ sizeof(VkDrawIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndirectCount-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdDrawIndirectCount-buffer-parameter
buffer
must be a valid VkBuffer handle -
VUID-vkCmdDrawIndirectCount-countBuffer-parameter
countBuffer
must be a valid VkBuffer handle -
VUID-vkCmdDrawIndirectCount-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdDrawIndirectCount-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdDrawIndirectCount-renderpass
This command must only be called inside of a render pass instance -
VUID-vkCmdDrawIndirectCount-commonparent
Each ofbuffer
,commandBuffer
, andcountBuffer
must have been created, allocated, or retrieved from the same VkDevice
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Inside |
Graphics |
Action |
To record an indexed indirect drawing command, call:
// Provided by VK_VERSION_1_0
void vkCmdDrawIndexedIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride);
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer containing draw parameters. -
offset
is the byte offset intobuffer
where parameters begin. -
drawCount
is the number of draws to execute, and can be zero. -
stride
is the byte stride between successive sets of draw parameters.
vkCmdDrawIndexedIndirect
behaves similarly to vkCmdDrawIndexed
except that the parameters are read by the device from a buffer during
execution.
drawCount
draws are executed by the command, with parameters taken
from buffer
starting at offset
and increasing by stride
bytes for each successive draw.
The parameters of each draw are encoded in an array of
VkDrawIndexedIndirectCommand structures.
If drawCount
is less than or equal to one, stride
is ignored.
-
VUID-vkCmdDrawIndexedIndirect-magFilter-04553
If a VkSampler created withmagFilter
orminFilter
equal toVK_FILTER_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndexedIndirect-mipmapMode-04770
If a VkSampler created withmipmapMode
equal toVK_SAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndexedIndirect-None-06479
If a VkImageView is sampled with depth comparison, the image view’s format features must containVK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
-
VUID-vkCmdDrawIndexedIndirect-None-02691
If a VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
-
VUID-vkCmdDrawIndexedIndirect-None-07888
If aVK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
-
VUID-vkCmdDrawIndexedIndirect-OpTypeImage-07027
For any VkImageView being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirect-OpTypeImage-07028
For any VkImageView being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirect-OpTypeImage-07029
For any VkBufferView being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirect-OpTypeImage-07030
Any VkBufferView being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirect-None-02697
For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexedIndirect-None-02698
For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexedIndirect-maintenance4-06425
If themaintenance4
feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexedIndirect-None-02699
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by a bound shader -
VUID-vkCmdDrawIndexedIndirect-None-02700
A valid pipeline must be bound to the pipeline bind point used by this command -
VUID-vkCmdDrawIndexedIndirect-None-02859
There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound -
VUID-vkCmdDrawIndexedIndirect-None-02702
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
VUID-vkCmdDrawIndexedIndirect-None-02703
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
VUID-vkCmdDrawIndexedIndirect-None-02704
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage -
VUID-vkCmdDrawIndexedIndirect-None-02705
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndexedIndirect-None-02706
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndexedIndirect-commandBuffer-02707
IfcommandBuffer
is an unprotected command buffer andprotectedNoFault
is not supported, any resource accessed by bound shaders must not be a protected resource -
VUID-vkCmdDrawIndexedIndirect-None-06550
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions -
VUID-vkCmdDrawIndexedIndirect-ConstOffset-06551
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands -
VUID-vkCmdDrawIndexedIndirect-viewType-07752
If a VkImageView is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in Instruction/Sampler/Image View Validation -
VUID-vkCmdDrawIndexedIndirect-format-07753
If a VkImageView is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match -
VUID-vkCmdDrawIndexedIndirect-OpImageWrite-08795
If a VkImageView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format -
VUID-vkCmdDrawIndexedIndirect-OpImageWrite-04469
If a VkBufferView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format -
VUID-vkCmdDrawIndexedIndirect-None-07288
Any shader invocation executed by this command must terminate -
VUID-vkCmdDrawIndexedIndirect-renderPass-02684
The current render pass must be compatible with therenderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndexedIndirect-subpass-02685
The subpass index of the current render pass must be equal to thesubpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndexedIndirect-None-07748
If any shader statically accesses an input attachment, a valid descriptor must be bound to the pipeline via a descriptor set -
VUID-vkCmdDrawIndexedIndirect-OpTypeImage-07468
If any shader executed by this pipeline accesses anOpTypeImage
variable with aDim
operand ofSubpassData
, it must be decorated with anInputAttachmentIndex
that corresponds to a valid input attachment in the current subpass -
VUID-vkCmdDrawIndexedIndirect-None-07469
Input attachment views accessed in a subpass must be created with the same VkFormat as the corresponding subpass definition, and be created with a VkImageView that is compatible with the attachment referenced by the subpass'pInputAttachments
[InputAttachmentIndex
] in the currently bound VkFramebuffer as specified by Fragment Input Attachment Compatibility -
VUID-vkCmdDrawIndexedIndirect-None-06537
Memory backing image subresources used as attachments in the current render pass must not be written in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirect-None-09000
If a color attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirect-None-09001
If a depth attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirect-None-09002
If a stencil attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirect-None-06539
If any previously recorded command in the current subpass accessed an image subresource used as an attachment in this subpass in any way other than as an attachment, this command must not write to that image subresource as an attachment -
VUID-vkCmdDrawIndexedIndirect-None-06886
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the depth aspect, depth writes must be disabled -
VUID-vkCmdDrawIndexedIndirect-None-06887
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the stencil aspect, both front and backwriteMask
are not zero, and stencil test is enabled, all stencil ops must beVK_STENCIL_OP_KEEP
-
VUID-vkCmdDrawIndexedIndirect-None-07831
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled then vkCmdSetViewport must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07832
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR
dynamic state enabled then vkCmdSetScissor must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07833
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled then vkCmdSetLineWidth must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07834
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled then vkCmdSetDepthBias must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07835
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled then vkCmdSetBlendConstants must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07836
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then vkCmdSetDepthBounds must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07837
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled then vkCmdSetStencilCompareMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07838
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled then vkCmdSetStencilWriteMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07839
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled then vkCmdSetStencilReference must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-02688
If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
-
VUID-vkCmdDrawIndexedIndirect-None-07840
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_CULL_MODE
dynamic state enabled then vkCmdSetCullMode must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07841
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_FRONT_FACE
dynamic state enabled then vkCmdSetFrontFace must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07843
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07844
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE
dynamic state enabled then vkCmdSetDepthWriteEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07845
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_COMPARE_OP
dynamic state enabled then vkCmdSetDepthCompareOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07846
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthBoundsTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07847
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_TEST_ENABLE
dynamic state enabled then vkCmdSetStencilTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-07848
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_OP
dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-viewportCount-03417
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, then vkCmdSetViewportWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match theVkPipelineViewportStateCreateInfo
::scissorCount
of the pipeline -
VUID-vkCmdDrawIndexedIndirect-scissorCount-03418
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, then vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and thescissorCount
parameter ofvkCmdSetScissorWithCount
must match theVkPipelineViewportStateCreateInfo
::viewportCount
of the pipeline -
VUID-vkCmdDrawIndexedIndirect-viewportCount-03419
If the bound graphics pipeline state was created with both theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
andVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic states enabled then both vkCmdSetViewportWithCount and vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match thescissorCount
parameter ofvkCmdSetScissorWithCount
-
VUID-vkCmdDrawIndexedIndirect-None-04876
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
dynamic state enabled then vkCmdSetRasterizerDiscardEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-None-04877
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE
dynamic state enabled then vkCmdSetDepthBiasEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-blendEnable-04727
If rasterization is not disabled in the bound graphics pipeline, then for each color attachment in the subpass, if the corresponding image view’s format features do not containVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
, then theblendEnable
member of the corresponding element of thepAttachments
member ofpColorBlendState
must beVK_FALSE
-
VUID-vkCmdDrawIndexedIndirect-rasterizationSamples-04740
If rasterization is not disabled in the bound graphics pipeline, and neither the
nor theVK_AMD_mixed_attachment_samples
extensions are enabled, thenVK_NV_framebuffer_mixed_samples
rasterizationSamples
for the currently bound graphics pipeline must be the same as the current subpass color and/or depth/stencil attachments -
VUID-vkCmdDrawIndexedIndirect-imageView-06172
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexedIndirect-imageView-06173
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexedIndirect-imageView-06174
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexedIndirect-imageView-06175
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexedIndirect-imageView-06176
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexedIndirect-imageView-06177
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexedIndirect-viewMask-06178
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::viewMask
equal to VkRenderingInfo::viewMask
-
VUID-vkCmdDrawIndexedIndirect-colorAttachmentCount-06179
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount
equal to VkRenderingInfo::colorAttachmentCount
-
VUID-vkCmdDrawIndexedIndirect-colorAttachmentCount-06180
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
not equal to VK_NULL_HANDLE must have been created with a VkFormat equal to the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound graphics pipeline -
VUID-vkCmdDrawIndexedIndirect-colorAttachmentCount-07616
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
equal to VK_NULL_HANDLE must have the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound pipeline equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirect-pDepthAttachment-06181
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pDepthAttachment->imageView
-
VUID-vkCmdDrawIndexedIndirect-pDepthAttachment-07617
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirect-pStencilAttachment-06182
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pStencilAttachment->imageView
-
VUID-vkCmdDrawIndexedIndirect-pStencilAttachment-07618
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirect-pColorAttachments-08963
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound with a fragment shader that statically writes to a color attachment, the color write mask is not zero, color writes are enabled, and the corresponding element of the VkRenderingInfo::pColorAttachments->imageView
was not VK_NULL_HANDLE, then the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirect-pDepthAttachment-08964
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, depth test is enabled, depth write is enabled, and the VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirect-pStencilAttachment-08965
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, stencil test is enabled and the VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirect-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source or destination blend factors for that attachment use the secondary color input, the maximum value ofLocation
for any output attachment statically used in theFragment
Execution
Model
executed by this command must be less thanmaxFragmentDualSrcAttachments
-
VUID-vkCmdDrawIndexedIndirect-None-04007
All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have either valid or VK_NULL_HANDLE buffers bound -
VUID-vkCmdDrawIndexedIndirect-None-04008
If thenullDescriptor
feature is not enabled, all vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must not be VK_NULL_HANDLE -
VUID-vkCmdDrawIndexedIndirect-None-02721
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-vkCmdDrawIndexedIndirect-None-07842
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then vkCmdSetPrimitiveTopology must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirect-primitiveTopology-03420
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then theprimitiveTopology
parameter ofvkCmdSetPrimitiveTopology
must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology
state -
VUID-vkCmdDrawIndexedIndirect-pStrides-04884
If the bound graphics pipeline was created with theVK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT
dynamic state enabled, thenvkCmdBindVertexBuffers2EXT
must have been called in the current command buffer prior to this drawing command, and thepStrides
parameter ofvkCmdBindVertexBuffers2EXT
must not beNULL
-
VUID-vkCmdDrawIndexedIndirect-None-04879
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
dynamic state enabled then vkCmdSetPrimitiveRestartEnable must have been called in the current command buffer prior to this drawing command
-
VUID-vkCmdDrawIndexedIndirect-buffer-02708
Ifbuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-vkCmdDrawIndexedIndirect-buffer-02709
buffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdDrawIndexedIndirect-offset-02710
offset
must be a multiple of4
-
VUID-vkCmdDrawIndexedIndirect-commandBuffer-02711
commandBuffer
must not be a protected command buffer
-
VUID-vkCmdDrawIndexedIndirect-drawCount-02718
If themultiDrawIndirect
feature is not enabled,drawCount
must be0
or1
-
VUID-vkCmdDrawIndexedIndirect-drawCount-02719
drawCount
must be less than or equal toVkPhysicalDeviceLimits
::maxDrawIndirectCount
-
VUID-vkCmdDrawIndexedIndirect-None-07312
An index buffer must be bound -
VUID-vkCmdDrawIndexedIndirect-robustBufferAccess2-07825
IfrobustBufferAccess2
is not enabled, (indexSize
× (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the bound index buffer, withindexSize
being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
-
VUID-vkCmdDrawIndexedIndirect-drawCount-00528
IfdrawCount
is greater than1
,stride
must be a multiple of4
and must be greater than or equal tosizeof
(VkDrawIndexedIndirectCommand
) -
VUID-vkCmdDrawIndexedIndirect-drawCount-00539
IfdrawCount
is equal to1
, (offset
+sizeof
(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndexedIndirect-drawCount-00540
IfdrawCount
is greater than1
, (stride
× (drawCount
- 1) +offset
+sizeof
(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndexedIndirect-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdDrawIndexedIndirect-buffer-parameter
buffer
must be a valid VkBuffer handle -
VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdDrawIndexedIndirect-renderpass
This command must only be called inside of a render pass instance -
VUID-vkCmdDrawIndexedIndirect-commonparent
Both ofbuffer
, andcommandBuffer
must have been created, allocated, or retrieved from the same VkDevice
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Inside |
Graphics |
Action |
The VkDrawIndexedIndirectCommand
structure is defined as:
// Provided by VK_VERSION_1_0
typedef struct VkDrawIndexedIndirectCommand {
uint32_t indexCount;
uint32_t instanceCount;
uint32_t firstIndex;
int32_t vertexOffset;
uint32_t firstInstance;
} VkDrawIndexedIndirectCommand;
-
indexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstIndex
is the base index within the index buffer. -
vertexOffset
is the value added to the vertex index before indexing into the vertex buffer. -
firstInstance
is the instance ID of the first instance to draw.
The members of VkDrawIndexedIndirectCommand
have the same meaning as
the similarly named parameters of vkCmdDrawIndexed.
-
VUID-VkDrawIndexedIndirectCommand-robustBufferAccess2-08797
IfrobustBufferAccess2
is not enabled, (indexSize
× (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the bound index buffer, withindexSize
being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
-
VUID-VkDrawIndexedIndirectCommand-None-00552
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-VkDrawIndexedIndirectCommand-firstInstance-00554
If thedrawIndirectFirstInstance
feature is not enabled,firstInstance
must be0
To record an indexed draw call with a draw call count sourced from a buffer, call:
// Provided by VK_VERSION_1_2
void vkCmdDrawIndexedIndirectCount(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkBuffer countBuffer,
VkDeviceSize countBufferOffset,
uint32_t maxDrawCount,
uint32_t stride);
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer containing draw parameters. -
offset
is the byte offset intobuffer
where parameters begin. -
countBuffer
is the buffer containing the draw count. -
countBufferOffset
is the byte offset intocountBuffer
where the draw count begins. -
maxDrawCount
specifies the maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified incountBuffer
andmaxDrawCount
. -
stride
is the byte stride between successive sets of draw parameters.
vkCmdDrawIndexedIndirectCount
behaves similarly to
vkCmdDrawIndexedIndirect except that the draw count is read by the
device from a buffer during execution.
The command will read an unsigned 32-bit integer from countBuffer
located at countBufferOffset
and use this as the draw count.
-
VUID-vkCmdDrawIndexedIndirectCount-magFilter-04553
If a VkSampler created withmagFilter
orminFilter
equal toVK_FILTER_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-mipmapMode-04770
If a VkSampler created withmipmapMode
equal toVK_SAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toVK_FALSE
is used to sample a VkImageView as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-None-06479
If a VkImageView is sampled with depth comparison, the image view’s format features must containVK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-None-02691
If a VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-None-07888
If aVK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-OpTypeImage-07027
For any VkImageView being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-OpTypeImage-07028
For any VkImageView being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-OpTypeImage-07029
For any VkBufferView being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-OpTypeImage-07030
Any VkBufferView being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containVK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
-
VUID-vkCmdDrawIndexedIndirectCount-None-02697
For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexedIndirectCount-None-02698
For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexedIndirectCount-maintenance4-06425
If themaintenance4
feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility -
VUID-vkCmdDrawIndexedIndirectCount-None-02699
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by a bound shader -
VUID-vkCmdDrawIndexedIndirectCount-None-02700
A valid pipeline must be bound to the pipeline bind point used by this command -
VUID-vkCmdDrawIndexedIndirectCount-None-02859
There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound -
VUID-vkCmdDrawIndexedIndirectCount-None-02702
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
VUID-vkCmdDrawIndexedIndirectCount-None-02703
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
VUID-vkCmdDrawIndexedIndirectCount-None-02704
If the VkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage -
VUID-vkCmdDrawIndexedIndirectCount-None-02705
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndexedIndirectCount-None-02706
If therobustBufferAccess
feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point -
VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02707
IfcommandBuffer
is an unprotected command buffer andprotectedNoFault
is not supported, any resource accessed by bound shaders must not be a protected resource -
VUID-vkCmdDrawIndexedIndirectCount-None-06550
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions -
VUID-vkCmdDrawIndexedIndirectCount-ConstOffset-06551
If a bound shader accesses a VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands -
VUID-vkCmdDrawIndexedIndirectCount-viewType-07752
If a VkImageView is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in Instruction/Sampler/Image View Validation -
VUID-vkCmdDrawIndexedIndirectCount-format-07753
If a VkImageView is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match -
VUID-vkCmdDrawIndexedIndirectCount-OpImageWrite-08795
If a VkImageView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format -
VUID-vkCmdDrawIndexedIndirectCount-OpImageWrite-04469
If a VkBufferView is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format -
VUID-vkCmdDrawIndexedIndirectCount-None-07288
Any shader invocation executed by this command must terminate -
VUID-vkCmdDrawIndexedIndirectCount-renderPass-02684
The current render pass must be compatible with therenderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndexedIndirectCount-subpass-02685
The subpass index of the current render pass must be equal to thesubpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
-
VUID-vkCmdDrawIndexedIndirectCount-None-07748
If any shader statically accesses an input attachment, a valid descriptor must be bound to the pipeline via a descriptor set -
VUID-vkCmdDrawIndexedIndirectCount-OpTypeImage-07468
If any shader executed by this pipeline accesses anOpTypeImage
variable with aDim
operand ofSubpassData
, it must be decorated with anInputAttachmentIndex
that corresponds to a valid input attachment in the current subpass -
VUID-vkCmdDrawIndexedIndirectCount-None-07469
Input attachment views accessed in a subpass must be created with the same VkFormat as the corresponding subpass definition, and be created with a VkImageView that is compatible with the attachment referenced by the subpass'pInputAttachments
[InputAttachmentIndex
] in the currently bound VkFramebuffer as specified by Fragment Input Attachment Compatibility -
VUID-vkCmdDrawIndexedIndirectCount-None-06537
Memory backing image subresources used as attachments in the current render pass must not be written in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirectCount-None-09000
If a color attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirectCount-None-09001
If a depth attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirectCount-None-09002
If a stencil attachment is written by any prior command in this subpass or by the load, store, or resolve operations for this subpass, it must not be accessed in any way other than as an attachment by this command -
VUID-vkCmdDrawIndexedIndirectCount-None-06539
If any previously recorded command in the current subpass accessed an image subresource used as an attachment in this subpass in any way other than as an attachment, this command must not write to that image subresource as an attachment -
VUID-vkCmdDrawIndexedIndirectCount-None-06886
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the depth aspect, depth writes must be disabled -
VUID-vkCmdDrawIndexedIndirectCount-None-06887
If the current render pass instance uses a depth/stencil attachment with a read-only layout for the stencil aspect, both front and backwriteMask
are not zero, and stencil test is enabled, all stencil ops must beVK_STENCIL_OP_KEEP
-
VUID-vkCmdDrawIndexedIndirectCount-None-07831
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled then vkCmdSetViewport must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07832
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR
dynamic state enabled then vkCmdSetScissor must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07833
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled then vkCmdSetLineWidth must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07834
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled then vkCmdSetDepthBias must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07835
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled then vkCmdSetBlendConstants must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07836
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then vkCmdSetDepthBounds must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07837
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled then vkCmdSetStencilCompareMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07838
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled then vkCmdSetStencilWriteMask must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07839
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled then vkCmdSetStencilReference must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-maxMultiviewInstanceIndex-02688
If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
-
VUID-vkCmdDrawIndexedIndirectCount-None-07840
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_CULL_MODE
dynamic state enabled then vkCmdSetCullMode must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07841
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_FRONT_FACE
dynamic state enabled then vkCmdSetFrontFace must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07843
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07844
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE
dynamic state enabled then vkCmdSetDepthWriteEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07845
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_COMPARE_OP
dynamic state enabled then vkCmdSetDepthCompareOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07846
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE
dynamic state enabled then vkCmdSetDepthBoundsTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07847
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_TEST_ENABLE
dynamic state enabled then vkCmdSetStencilTestEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-07848
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_STENCIL_OP
dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-viewportCount-03417
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, then vkCmdSetViewportWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match theVkPipelineViewportStateCreateInfo
::scissorCount
of the pipeline -
VUID-vkCmdDrawIndexedIndirectCount-scissorCount-03418
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
dynamic state enabled, but not theVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic state enabled, then vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and thescissorCount
parameter ofvkCmdSetScissorWithCount
must match theVkPipelineViewportStateCreateInfo
::viewportCount
of the pipeline -
VUID-vkCmdDrawIndexedIndirectCount-viewportCount-03419
If the bound graphics pipeline state was created with both theVK_DYNAMIC_STATE_SCISSOR_WITH_COUNT
andVK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT
dynamic states enabled then both vkCmdSetViewportWithCount and vkCmdSetScissorWithCount must have been called in the current command buffer prior to this drawing command, and theviewportCount
parameter ofvkCmdSetViewportWithCount
must match thescissorCount
parameter ofvkCmdSetScissorWithCount
-
VUID-vkCmdDrawIndexedIndirectCount-None-04876
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
dynamic state enabled then vkCmdSetRasterizerDiscardEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-None-04877
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE
dynamic state enabled then vkCmdSetDepthBiasEnable must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-blendEnable-04727
If rasterization is not disabled in the bound graphics pipeline, then for each color attachment in the subpass, if the corresponding image view’s format features do not containVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
, then theblendEnable
member of the corresponding element of thepAttachments
member ofpColorBlendState
must beVK_FALSE
-
VUID-vkCmdDrawIndexedIndirectCount-rasterizationSamples-04740
If rasterization is not disabled in the bound graphics pipeline, and neither the
nor theVK_AMD_mixed_attachment_samples
extensions are enabled, thenVK_NV_framebuffer_mixed_samples
rasterizationSamples
for the currently bound graphics pipeline must be the same as the current subpass color and/or depth/stencil attachments -
VUID-vkCmdDrawIndexedIndirectCount-imageView-06172
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexedIndirectCount-imageView-06173
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexedIndirectCount-imageView-06174
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexedIndirectCount-imageView-06175
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexedIndirectCount-imageView-06176
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpDepthAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpDepthAttachment
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
, this command must not write any values to the depth attachment -
VUID-vkCmdDrawIndexedIndirectCount-imageView-06177
If the current render pass instance was begun with vkCmdBeginRendering, theimageView
member ofpStencilAttachment
is not VK_NULL_HANDLE, and thelayout
member ofpStencilAttachment
isVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
, this command must not write any values to the stencil attachment -
VUID-vkCmdDrawIndexedIndirectCount-viewMask-06178
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::viewMask
equal to VkRenderingInfo::viewMask
-
VUID-vkCmdDrawIndexedIndirectCount-colorAttachmentCount-06179
If the current render pass instance was begun with vkCmdBeginRendering, the currently bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount
equal to VkRenderingInfo::colorAttachmentCount
-
VUID-vkCmdDrawIndexedIndirectCount-colorAttachmentCount-06180
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
not equal to VK_NULL_HANDLE must have been created with a VkFormat equal to the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound graphics pipeline -
VUID-vkCmdDrawIndexedIndirectCount-colorAttachmentCount-07616
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::colorAttachmentCount
greater than0
, then each element of the VkRenderingInfo::pColorAttachments
array with aimageView
equal to VK_NULL_HANDLE must have the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the currently bound pipeline equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirectCount-pDepthAttachment-06181
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pDepthAttachment->imageView
-
VUID-vkCmdDrawIndexedIndirectCount-pDepthAttachment-07617
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pDepthAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirectCount-pStencilAttachment-06182
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal to the VkFormat used to create VkRenderingInfo::pStencilAttachment->imageView
-
VUID-vkCmdDrawIndexedIndirectCount-pStencilAttachment-07618
If the current render pass instance was begun with vkCmdBeginRendering and VkRenderingInfo::pStencilAttachment->imageView
was VK_NULL_HANDLE, the value of VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the currently bound graphics pipeline must be equal toVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirectCount-pColorAttachments-08963
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound with a fragment shader that statically writes to a color attachment, the color write mask is not zero, color writes are enabled, and the corresponding element of the VkRenderingInfo::pColorAttachments->imageView
was not VK_NULL_HANDLE, then the corresponding element of VkPipelineRenderingCreateInfo::pColorAttachmentFormats
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirectCount-pDepthAttachment-08964
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, depth test is enabled, depth write is enabled, and the VkRenderingInfo::pDepthAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::depthAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirectCount-pStencilAttachment-08965
If the current render pass instance was begun with vkCmdBeginRendering, there is a graphics pipeline bound, stencil test is enabled and the VkRenderingInfo::pStencilAttachment->imageView
was not VK_NULL_HANDLE, then the VkPipelineRenderingCreateInfo::stencilAttachmentFormat
used to create the pipeline must not beVK_FORMAT_UNDEFINED
-
VUID-vkCmdDrawIndexedIndirectCount-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source or destination blend factors for that attachment use the secondary color input, the maximum value ofLocation
for any output attachment statically used in theFragment
Execution
Model
executed by this command must be less thanmaxFragmentDualSrcAttachments
-
VUID-vkCmdDrawIndexedIndirectCount-None-04007
All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have either valid or VK_NULL_HANDLE buffers bound -
VUID-vkCmdDrawIndexedIndirectCount-None-04008
If thenullDescriptor
feature is not enabled, all vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must not be VK_NULL_HANDLE -
VUID-vkCmdDrawIndexedIndirectCount-None-02721
For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description -
VUID-vkCmdDrawIndexedIndirectCount-None-07842
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then vkCmdSetPrimitiveTopology must have been called in the current command buffer prior to this drawing command -
VUID-vkCmdDrawIndexedIndirectCount-primitiveTopology-03420
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY
dynamic state enabled then theprimitiveTopology
parameter ofvkCmdSetPrimitiveTopology
must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology
state -
VUID-vkCmdDrawIndexedIndirectCount-pStrides-04884
If the bound graphics pipeline was created with theVK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT
dynamic state enabled, thenvkCmdBindVertexBuffers2EXT
must have been called in the current command buffer prior to this drawing command, and thepStrides
parameter ofvkCmdBindVertexBuffers2EXT
must not beNULL
-
VUID-vkCmdDrawIndexedIndirectCount-None-04879
If the bound graphics pipeline state was created with theVK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE
dynamic state enabled then vkCmdSetPrimitiveRestartEnable must have been called in the current command buffer prior to this drawing command
-
VUID-vkCmdDrawIndexedIndirectCount-buffer-02708
Ifbuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-vkCmdDrawIndexedIndirectCount-buffer-02709
buffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdDrawIndexedIndirectCount-offset-02710
offset
must be a multiple of4
-
VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02711
commandBuffer
must not be a protected command buffer
-
VUID-vkCmdDrawIndexedIndirectCount-countBuffer-02714
IfcountBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-vkCmdDrawIndexedIndirectCount-countBuffer-02715
countBuffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdDrawIndexedIndirectCount-countBufferOffset-02716
countBufferOffset
must be a multiple of4
-
VUID-vkCmdDrawIndexedIndirectCount-countBuffer-02717
The count stored incountBuffer
must be less than or equal toVkPhysicalDeviceLimits
::maxDrawIndirectCount
-
VUID-vkCmdDrawIndexedIndirectCount-countBufferOffset-04129
(countBufferOffset
+sizeof
(uint32_t)) must be less than or equal to the size ofcountBuffer
-
VUID-vkCmdDrawIndexedIndirectCount-None-04445
IfdrawIndirectCount
is not enabled this function must not be used
-
VUID-vkCmdDrawIndexedIndirectCount-None-07312
An index buffer must be bound -
VUID-vkCmdDrawIndexedIndirectCount-robustBufferAccess2-07825
IfrobustBufferAccess2
is not enabled, (indexSize
× (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the bound index buffer, withindexSize
being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
-
VUID-vkCmdDrawIndexedIndirectCount-stride-03142
stride
must be a multiple of4
and must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand
) -
VUID-vkCmdDrawIndexedIndirectCount-maxDrawCount-03143
IfmaxDrawCount
is greater than or equal to1
, (stride
× (maxDrawCount
- 1) +offset
+ sizeof(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndexedIndirectCount-countBuffer-03153
If count stored incountBuffer
is equal to1
, (offset
+ sizeof(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndexedIndirectCount-countBuffer-03154
If count stored incountBuffer
is greater than1
, (stride
× (drawCount
- 1) +offset
+ sizeof(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
-
VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdDrawIndexedIndirectCount-buffer-parameter
buffer
must be a valid VkBuffer handle -
VUID-vkCmdDrawIndexedIndirectCount-countBuffer-parameter
countBuffer
must be a valid VkBuffer handle -
VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdDrawIndexedIndirectCount-renderpass
This command must only be called inside of a render pass instance -
VUID-vkCmdDrawIndexedIndirectCount-commonparent
Each ofbuffer
,commandBuffer
, andcountBuffer
must have been created, allocated, or retrieved from the same VkDevice
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Command Type |
---|---|---|---|
Primary |
Inside |
Graphics |
Action |