---
title: "setTessellationFactorBuffer(_:offset:instanceStride:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/settessellationfactorbuffer(_:offset:instancestride:)"
---

# setTessellationFactorBuffer(_:offset:instanceStride:)

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

## Declaration

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

## Parameters

- `buffer`: An doc://com.apple.metal/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

Discussion Call this method before encoding patch-drawing commands.

## See Also

### Configuring tessellation factors

- [setTessellationFactorScale(_:)](metal/mtlrendercommandencoder/settessellationfactorscale(_:).md)
