---
title: "commit:count:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4commandqueue/commit:count:"
---

# commit:count:

Enqueues an array of command buffers for execution.

## Declaration

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

## Parameters

- `commandBuffers`: An array of doc://com.apple.metal/documentation/Metal/MTL4CommandBuffer.
- `count`: The number of doc://com.apple.metal/documentation/Metal/MTL4CommandBuffer instances in the commandBuffers array.

## Mentioned in

Understanding the Metal 4 core API

## Discussion

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:), 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.
