---
title: commit()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtliocommandbuffer/commit()
---

# commit()

Submits the command buffer to the queue for execution on the GPU.

## Declaration

```swift
func commit()
```

## Discussion

Discussion If you haven’t already called enqueue() for the command buffer, the commit() method enqueues it at the next position in the input/output command queue. You can only commit an input/output command buffer once, after which you can’t encode any additional commands or add more completion handlers to it.

## See Also

### Submitting a command buffer

- [enqueue()](metal/mtliocommandbuffer/enqueue().md)
