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

# commit:count:

Enqueues an array of command buffers for execution.

```
- (void) commit:(id<MTL4CommandBuffer> const[]) commandBuffers count:(NSUInteger) count;
```

## Parameters

`commandBuffers`

an array of [`MTL4CommandBuffer`](/documentation/Metal/MTL4CommandBuffer).

`count`

the number of [`MTL4CommandBuffer`](/documentation/Metal/MTL4CommandBuffer) instances in the `commandBuffers` array.

## Discussion

The order in which you sort the command buffers in the array is meaningful, especially when it contains suspending/resuming
render passes. A suspending/resuming render pass is a render pass you create by calling
[`makeRenderCommandEncoder(descriptor:options:)`](/documentation/Metal/MTL4CommandBuffer/makeRenderCommandEncoder(descriptor:options:)),
and provide `MTL4RenderEncoderOptionSuspending` or `MTL4RenderEncoderOptionResuming` for the `options` parameter.

If your command buffers contain suspend/resume render passes, ensure that the first command buffer only suspends,
and the last one only resumes. Additionally, make sure that all intermediate command buffers are both suspending
and resuming.

---

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)