<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/creating-an-indirect-command-buffer",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Creating an indirect command buffer"
}
-->

# Creating an indirect command buffer

Configure a descriptor to specify the properties of an indirect command buffer.

## Discussion

An indirect command buffer stores encoded GPU commands persistently. Using an indirect command buffer, you can encode a command once and reuse it multiple times. You can also encode commands into an indirect command buffer simultaneously with multiple threads on the CPU or with a compute kernel on the GPU.

To create an indirect command buffer, first create an [`MTLIndirectCommandBufferDescriptor`](/documentation/Metal/MTLIndirectCommandBufferDescriptor) instance and configure the descriptor’s properties. Then call [`makeIndirectCommandBuffer(descriptor:maxCommandCount:options:)`](/documentation/Metal/MTLDevice/makeIndirectCommandBuffer(descriptor:maxCommandCount:options:)) on an [`MTLDevice`](/documentation/Metal/MTLDevice) instance to create the indirect command buffer.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)