---
title: "setTileBuffer(_:offset:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/settilebuffer(_:offset:index:)"
---

# setTileBuffer(_:offset:index:)

Assigns a buffer to an entry in the tile shader argument table.

## Declaration

```swift
func setTileBuffer(_ buffer: (any MTLBuffer)?, offset: Int, index: Int)
```

## Parameters

- `buffer`: An doc://com.apple.metal/documentation/Metal/MTLBuffer instance the command assigns to an entry in the tile shader argument table for buffers.
- `offset`: An integer that represents the location, in bytes, from the start of buffer where the tile shader argument data begins. See the https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf to check for offset alignment requirements for buffers in device and constant address space.
- `index`: An integer that represents the entry in the tile shader argument table for buffers that stores a record of buffer and offset.

## Mentioned in

Improving CPU performance by using argument buffers

## Discussion

Discussion By default, the buffer at each index is nil.

## See Also

### Assigning buffers

- [setTileBuffers(_:offsets:range:)](metal/mtlrendercommandencoder/settilebuffers(_:offsets:range:).md)
- [setTileBytes(_:length:index:)](metal/mtlrendercommandencoder/settilebytes(_:length:index:).md)
- [setTileBufferOffset(_:index:)](metal/mtlrendercommandencoder/settilebufferoffset(_:index:).md)
