---
title: MTLCommandBufferDescriptor
framework: metal
role: symbol
role_heading: Class
path: metal/mtlcommandbufferdescriptor
---

# MTLCommandBufferDescriptor

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

## Declaration

```swift
class MTLCommandBufferDescriptor
```

## Overview

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

## Topics

### Configuring the command buffer

- [logState](metal/mtlcommandbufferdescriptor/logstate.md)
- [retainedReferences](metal/mtlcommandbufferdescriptor/retainedreferences.md)
- [errorOptions](metal/mtlcommandbufferdescriptor/erroroptions.md)
- [MTLCommandBufferErrorOption](metal/mtlcommandbuffererroroption.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Submitting work to a GPU with Metal

- [Setting up a command structure](metal/setting-up-a-command-structure.md)
- [MTLCommandQueue](metal/mtlcommandqueue.md)
- [MTLCommandQueueDescriptor](metal/mtlcommandqueuedescriptor.md)
- [MTLCommandBuffer](metal/mtlcommandbuffer.md)
- [MTLCommandBufferError](metal/mtlcommandbuffererror-swift.struct.md)
- [MTLCommandEncoder](metal/mtlcommandencoder.md)
