---
title: "setBuffer(_:offset:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlintersectionfunctiontable/setbuffer(_:offset:index:)"
---

# setBuffer(_:offset:index:)

Sets a buffer for the intersection functions.

## Declaration

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

## Parameters

- `buffer`: The doc://com.apple.metal/documentation/Metal/MTLBuffer object to set in the argument table.
- `offset`: Where the data begins, in bytes, from the start of the buffer.
- `index`: An index in the function table’s buffer argument table.

## See Also

### Specifying arguments for intersection functions

- [setBuffers(_:offsets:range:)](metal/mtlintersectionfunctiontable/setbuffers(_:offsets:range:).md)
- [setVisibleFunctionTable(_:bufferIndex:)](metal/mtlintersectionfunctiontable/setvisiblefunctiontable(_:bufferindex:).md)
- [setVisibleFunctionTables(_:bufferRange:)](metal/mtlintersectionfunctiontable/setvisiblefunctiontables(_:bufferrange:).md)
