---
title: "drawPrimitives(primitiveType:vertexStart:vertexCount:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/drawprimitives(primitivetype:vertexstart:vertexcount:)"
---

# drawPrimitives(primitiveType:vertexStart:vertexCount:)

Encodes a draw command that renders an instance of a geometric primitive.

## Declaration

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

## Parameters

- `primitiveType`: A doc://com.apple.metal/documentation/Metal/MTLPrimitiveType representing how the command interprets vertex argument data.
- `vertexStart`: The lowest value the command passes to your vertex shader function’s parameter with the [[vertex_id]] attribute.
- `vertexCount`: An integer that represents the number of vertices of primitiveType the command draws.

## Discussion

Discussion This command assigns each vertex a unique vertex_id value that increases from vertexStart through (vertexStart + vertexCount - 1). Your vertex shader function can use this value to uniquely identify each vertex.

## See Also

### Drawing with vertices

- [drawPrimitives(primitiveType:vertexStart:vertexCount:instanceCount:)](metal/mtl4rendercommandencoder/drawprimitives(primitivetype:vertexstart:vertexcount:instancecount:).md)
- [drawPrimitives(primitiveType:vertexStart:vertexCount:instanceCount:baseInstance:)](metal/mtl4rendercommandencoder/drawprimitives(primitivetype:vertexstart:vertexcount:instancecount:baseinstance:).md)
- [drawPrimitives(primitiveType:indirectBuffer:)](metal/mtl4rendercommandencoder/drawprimitives(primitivetype:indirectbuffer:).md)
