<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIntersectionFunctionTable/setBuffer(_:offset:index:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLIntersectionFunctionTable(im)setBuffer:offset:atIndex:"
  },
  "title" : "setBuffer(_:offset:index:)"
}
-->

# setBuffer(_:offset:index:)

Sets a buffer for the intersection functions.

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

## Parameters

`buffer`

The [`MTLBuffer`](/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.

## Discussion

---

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)