<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandBufferDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLCommandBufferDescriptor"
  },
  "title" : "MTLCommandBufferDescriptor"
}
-->

# MTLCommandBufferDescriptor

A configuration that customizes the behavior for a new command buffer.

```
class MTLCommandBufferDescriptor
```

## Overview

Create a command buffer with a custom configuration by creating an [`MTLCommandBufferDescriptor`](/documentation/Metal/MTLCommandBufferDescriptor) instance and passing it to an [`MTLCommandQueue`](/documentation/Metal/MTLCommandQueue) instance’s [`makeCommandBuffer(descriptor:)`](/documentation/Metal/MTLCommandQueue/makeCommandBuffer(descriptor:)) method. You can configure whether the command buffer retains references to resources that its commands refer to with the [`retainedReferences`](/documentation/Metal/MTLCommandBufferDescriptor/retainedReferences) property. The command buffer can save extra error information, which is useful during development, by setting its [`errorOptions`](/documentation/Metal/MTLCommandBufferDescriptor/errorOptions) property to [`encoderExecutionStatus`](/documentation/Metal/MTLCommandBufferErrorOption/encoderExecutionStatus).

## Topics

### Configuring the command buffer

[`logState`](/documentation/Metal/MTLCommandBufferDescriptor/logState)

The shader logging configuration that the command buffer uses.

[`retainedReferences`](/documentation/Metal/MTLCommandBufferDescriptor/retainedReferences)

A Boolean value that indicates whether the command buffer the descriptor creates maintains strong references to the resources it uses.

[`errorOptions`](/documentation/Metal/MTLCommandBufferDescriptor/errorOptions)

The reporting configuration that indicates which information the GPU driver stores in a command buffer’s error property.

[`MTLCommandBufferErrorOption`](/documentation/Metal/MTLCommandBufferErrorOption)

Options for reporting errors from a command buffer.



---

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)