---
title: "drawPrimitives(_:vertexStart:vertexCount:instanceCount:baseInstance:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlindirectrendercommand/drawprimitives(_:vertexstart:vertexcount:instancecount:baseinstance:)"
---

# drawPrimitives(_:vertexStart:vertexCount:instanceCount:baseInstance:)

Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements, starting from the base instance.

## Declaration

```swift
func drawPrimitives(_ primitiveType: MTLPrimitiveType, vertexStart: Int, vertexCount: Int, instanceCount: Int, baseInstance: Int)
```

## Parameters

- `primitiveType`: The type of primitives that the vertices are assembled into.
- `vertexStart`: The first vertex to draw.
- `vertexCount`: The number of vertices to draw.
- `instanceCount`: The number of instances to draw.
- `baseInstance`: The first instance to draw.

## Discussion

Discussion The command generated by this method is equivalent to calling drawPrimitives(_:vertexStart:vertexCount:instanceCount:baseInstance:).

## See Also

### Encoding a drawing command

- [drawIndexedPrimitives(_:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:)](metal/mtlindirectrendercommand/drawindexedprimitives(_:indexcount:indextype:indexbuffer:indexbufferoffset:instancecount:basevertex:baseinstance:).md)
- [drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)](metal/mtlindirectrendercommand/drawpatches(_:patchstart:patchcount:patchindexbuffer:patchindexbufferoffset:instancecount:baseinstance:tessellationfactorbuffer:tessellationfactorbufferoffset:tessellationfactorbufferinstancestride:).md)
- [drawIndexedPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)](metal/mtlindirectrendercommand/drawindexedpatches(_:patchstart:patchcount:patchindexbuffer:patchindexbufferoffset:controlpointindexbuffer:controlpointindexbufferoffset:instancecount:baseinstance:tessellationfactorbuffer:tessellationfactorbufferoffset:tessellationfactorbu-4mdz8.md)
