---
title: "setObjectThreadgroupMemoryLength(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/setobjectthreadgroupmemorylength(_:index:)"
---

# setObjectThreadgroupMemoryLength(_:index:)

Configures the size of a threadgroup memory buffer for a threadgroup argument in the object shader function.

## Declaration

```swift
func setObjectThreadgroupMemoryLength(_ length: Int, index: Int)
```

## Parameters

- `length`: The size of the threadgroup memory, in bytes.
- `index`: An integer that corresponds to the index of the argument you annotate with attribute [[threadgroup(index)]] in the shader function.

## See Also

### Configuring persistent threadgroup memory

- [setThreadgroupMemoryLength(_:offset:index:)](metal/mtl4rendercommandencoder/setthreadgroupmemorylength(_:offset:index:).md)
