---
title: "setVertexAccelerationStructure(_:bufferIndex:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setvertexaccelerationstructure(_:bufferindex:)"
---

# setVertexAccelerationStructure(_:bufferIndex:)

Assigns an acceleration structure to an entry in the vertex shader argument table.

## Declaration

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

## Parameters

- `accelerationStructure`: An doc://com.apple.metal/documentation/Metal/MTLAccelerationStructure instance the command assigns to an entry in the vertex shader argument table for acceleration structures.
- `bufferIndex`: An integer that represents the entry in the vertex shader argument table for acceleration structures that stores a record of accelerationStructure.

## Discussion

Discussion By default, the acceleration structure at each index is nil.
