drawIndexedPrimitives(_:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:)
Encodes a command to render a number of instances of primitives using an index list specified in a buffer, starting from the base vertex of the base instance.
Declaration
func drawIndexedPrimitives(_ primitiveType: MTLPrimitiveType, indexCount: Int, indexType: MTLIndexType, indexBuffer: any MTLBuffer, indexBufferOffset: Int, instanceCount: Int, baseVertex: Int, baseInstance: Int)Parameters
- primitiveType:
The type of primitive that the vertices are assembled into.
- indexCount:
For each instance, the number of indices to read from the index buffer.
- indexType:
The data type of the indices.
- indexBuffer:
A buffer that contains indices to vertices.
- indexBufferOffset:
Byte offset within indexBuffer to start reading indices from.
- instanceCount:
The number of instances to draw.
- baseVertex:
The first vertex to draw.
- baseInstance:
The first instance to draw.
Discussion
The command generated by this method is equivalent to calling drawIndexedPrimitives(type:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:).
See Also
Encoding a drawing command
drawPrimitives(_:vertexStart:vertexCount:instanceCount:baseInstance:)drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)drawIndexedPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)