Vulkan-Docs/doc/specs/vulkan/man/vkCmdDrawIndexed.txt

81 lines
2.5 KiB
Plaintext

// Copyright (c) 2014-2016 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
vkCmdDrawIndexed(3)
===================
Name
----
vkCmdDrawIndexed - Issue an indexed draw into a command buffer.
C Specification
---------------
// refBegin vkCmdDrawIndexed Issue an indexed draw into a command buffer.
To record an indexed draw, call:
include::../protos/vkCmdDrawIndexed.txt[]
Parameters
----------
* pname:commandBuffer is the command buffer into which the command is
recorded.
* pname:indexCount is the number of vertices to draw.
* pname:instanceCount is the number of instances to draw.
* pname:firstIndex is the base index within the index buffer.
* pname:vertexOffset is the value added to the vertex index before indexing
into the vertex buffer.
* pname:firstInstance is the instance ID of the first instance to draw.
Description
-----------
When the command is executed, primitives are assembled using the current
primitive topology and pname: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
flink:vkCmdBindIndexBuffer::pname:indexType parameter with which the buffer
was bound.
The first vertex index is at an offset of pname:firstIndex * code:indexSize
+ pname:offset within the currently bound index buffer, where pname:offset
is the offset specified by fname:vkCmdBindIndexBuffer and code:indexSize is
the byte size of the type specified by pname: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 code:indexType is ename:VK_INDEX_TYPE_UINT16) and have
pname:vertexOffset added to them, before being supplied as the
code:vertexIndex value.
The primitives are drawn pname:instanceCount times with code:instanceIndex
starting with pname:firstInstance and increasing sequentially for each
instance. The assembled primitives execute the currently bound graphics
pipeline.
include::../validity/protos/vkCmdDrawIndexed.txt[]
See Also
--------
slink:VkCommandBuffer
Document Notes
--------------
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdDrawIndexed
This page is extracted from the Vulkan Specification.
Fixes and changes should be made to the Specification,not directly.
include::footer.txt[]