---
title: MTLIndirectCommandBuffer
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtlindirectcommandbuffer
---

# MTLIndirectCommandBuffer

A command buffer containing reusable commands, encoded either on the CPU or GPU.

## Declaration

```swift
protocol MTLIndirectCommandBuffer : MTLResource
```

## Mentioned in

Improving CPU performance by using argument buffers

## Overview

Overview Use an indirect command buffer to encode commands once and reuse them, and to encode commands on multiple CPU or GPU threads. Don’t implement this protocol yourself; instead, create an MTLIndirectCommandBufferDescriptor instance, configure its properties, and tell the MTLDevice to create the indirect command buffer. See Creating an indirect command buffer.

## Topics

### Determining the maximum number of commands

- [size](metal/mtlindirectcommandbuffer/size.md)

### Retrieving commands

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

### Resetting commands

- [reset(_:)](metal/mtlindirectcommandbuffer/reset(_:).md)

### Instance Properties

- [gpuResourceID](metal/mtlindirectcommandbuffer/gpuresourceid.md)

## Relationships

### Inherits From

- [MTLAllocation](metal/mtlallocation.md)
- [MTLResource](metal/mtlresource.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Indirect command buffers

- [Creating an indirect command buffer](metal/creating-an-indirect-command-buffer.md)
- [Specifying drawing and dispatch arguments indirectly](metal/specifying-drawing-and-dispatch-arguments-indirectly.md)
- [Encoding indirect command buffers on the CPU](metal/encoding-indirect-command-buffers-on-the-cpu.md)
- [Encoding indirect command buffers on the GPU](metal/encoding-indirect-command-buffers-on-the-gpu.md)
- [MTLIndirectCommandBufferDescriptor](metal/mtlindirectcommandbufferdescriptor.md)
- [MTLIndirectCommandType](metal/mtlindirectcommandtype.md)
- [MTLIndirectCommandBufferExecutionRange](metal/mtlindirectcommandbufferexecutionrange.md)
- [MTLIndirectCommandBufferExecutionRangeMake(_:_:)](metal/mtlindirectcommandbufferexecutionrangemake(_:_:).md)
