---
title: "indirectComputeCommandAt(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlindirectcommandbuffer/indirectcomputecommandat(_:)"
---

# indirectComputeCommandAt(_:)

Gets the compute command at the given index.

## Declaration

```swift
func indirectComputeCommandAt(_ commandIndex: Int) -> any MTLIndirectComputeCommand
```

## Parameters

- `commandIndex`: The index of the command to retrieve.

## Discussion

Discussion Call this method only if the indirect command buffer contains compute commands.

## See Also

### Retrieving commands

- [indirectRenderCommandAt(_:)](metal/mtlindirectcommandbuffer/indirectrendercommandat(_:).md)
- [indirectComputeCommand(at:)](metal/mtlindirectcommandbuffer/indirectcomputecommand(at:).md)
