<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandBuffer/enqueue()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLCommandBuffer(im)enqueue"
  },
  "title" : "enqueue()"
}
-->

# enqueue()

Reserves the next available place for the command buffer in its command queue.

```
func enqueue()
```

## Discussion

The [`enqueue()`](/documentation/Metal/MTLCommandBuffer/enqueue()) method adds the command buffer to the [`MTLCommandQueue`](/documentation/Metal/MTLCommandQueue) instance that owns it, but doesn’t commit the command buffer to run on the GPU. You can call the command buffer’s [`commit()`](/documentation/Metal/MTLCommandBuffer/commit()) method at a later time when it’s ready to run on the GPU. You can call a command buffer’s [`enqueue()`](/documentation/Metal/MTLCommandBuffer/enqueue()) method any time before you call [`commit()`](/documentation/Metal/MTLCommandBuffer/commit()), including before, after, or as you encode commands to it.

> Note:
> The command buffer can only reserve a place in its queue a single time; all subsequent ``doc://com.apple.metal/documentation/Metal/MTLCommandBuffer/enqueue()`` calls have no effect.

Enqueuing your command buffers first gives you the flexibility to arrange their relative order of execution before encoding commands to any of them. This approach lets you potentially encode each command buffer on a thread, in parallel, instead of encoding them one by one on a single thread. The order in which each worker thread finishes encoding and commits its command buffer doesn’t matter when you enqueue them in order before committing.

---

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)