<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 14.5.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIndirectRenderCommand/drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLIndirectRenderCommand(im)drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:"
  },
  "title" : "drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)"
}
-->

# drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)

Encodes a command to render a number of instances of tessellated patches.

```
func drawPatches(_ numberOfPatchControlPoints: Int, patchStart: Int, patchCount: Int, patchIndexBuffer: (any MTLBuffer)?, patchIndexBufferOffset: Int, instanceCount: Int, baseInstance: Int, tessellationFactorBuffer buffer: any MTLBuffer, tessellationFactorBufferOffset offset: Int, tessellationFactorBufferInstanceStride instanceStride: Int)
```

## Parameters

`numberOfPatchControlPoints`

The number of control points per patch.
This value needs to be between `0` and `32`, inclusive.

`patchStart`

The first patch to draw.

`patchCount`

The number of patches in each instance.

`patchIndexBuffer`

A buffer that contains indices to patches.

`patchIndexBufferOffset`

The byte offset within `patchIndexBuffer` to start reading indices from.

`instanceCount`

The number of instances to draw.

`baseInstance`

The first instance to draw.

`buffer`

The per-patch tessellation factors buffer.

`offset`

The distance, in bytes, between the start of the data and the start of the buffer. This value needs to be a multiple of `4` bytes.

`instanceStride`

The distance, in bytes, between two instances of data in the buffer.

## Discussion

The command generated by this method is equivalent to calling [`setTessellationFactorBuffer(_:offset:instanceStride:)`](/documentation/Metal/MTLRenderCommandEncoder/setTessellationFactorBuffer(_:offset:instanceStride:)) followed by [`drawPatches(numberOfPatchControlPoints:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:)`](/documentation/Metal/MTLRenderCommandEncoder/drawPatches(numberOfPatchControlPoints:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)