---
title: status
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcommandbuffer/status
---

# status

The command buffer’s current state.

## Declaration

```swift
var status: MTLCommandBufferStatus { get }
```

## Mentioned in

Preparing your Metal app to run in the background Setting up a command structure

## Discussion

Discussion Each command buffer can be in any one of the following states:  |   |   |   |   |   |   |  The first two states (MTLCommandBufferStatus.notEnqueued and MTLCommandBufferStatus.enqueued) both indicate that you can encode commands to the command buffer. You do this by creating an encoder that indirectly adds commands for a pass (see Command encoder factory methods) to the command buffer. Command buffers also have some methods that directly encode commands between passes, such as encodeSignalEvent(_:value:) and present(_:). Each command buffer’s state can only change to a state below it in the table, and ends its life cycle at either MTLCommandBufferStatus.completed or MTLCommandBufferStatus.error.

## See Also

### Troubleshooting a command buffer

- [MTLCommandBufferStatus](metal/mtlcommandbufferstatus.md)
- [Command buffer debugging](metal/command-buffer-debugging.md)
