---
title: "setAccelerationStructure(_:bufferIndex:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlcomputecommandencoder/setaccelerationstructure(_:bufferindex:)"
---

# setAccelerationStructure(_:bufferIndex:)

Binds an acceleration structure to the buffer argument table, allowing functions to access it on the GPU.

## Declaration

```swift
func setAccelerationStructure(_ accelerationStructure: (any MTLAccelerationStructure)?, bufferIndex: Int)
```

## Parameters

- `accelerationStructure`: An doc://com.apple.metal/documentation/Metal/MTLAccelerationStructure instance to bind to the argument table.
- `bufferIndex`: The index the structure binds to in the argument table.

## See Also

### Binding arguments for acceleration structures

- [setIntersectionFunctionTable(_:bufferIndex:)](metal/mtlcomputecommandencoder/setintersectionfunctiontable(_:bufferindex:).md)
