<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setTessellationFactorBuffer(_:offset:instanceStride:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)setTessellationFactorBuffer:offset:instanceStride:"
  },
  "title" : "setTessellationFactorBuffer(_:offset:instanceStride:)"
}
-->

# setTessellationFactorBuffer(_:offset:instanceStride:)

Configures the per-patch tessellation factors for any subsequent patch-drawing commands.

```
func setTessellationFactorBuffer(_ buffer: (any MTLBuffer)?, offset: Int, instanceStride: Int)
```

## Parameters

`buffer`

An [`MTLBuffer`](/documentation/Metal/MTLBuffer) instance that stores the per-patch tessellation factors, which can’t be empty or `nil`.

`offset`

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

`instanceStride`

The number of bytes between two instances of data in `buffer`, which needs to be a multiple of `4`.

## Discussion

Call this method before encoding patch-drawing commands.

---

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)