---
title: makeCommandBuffer()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtldevice/makecommandbuffer()
---

# makeCommandBuffer()

Creates a new command buffer.

## Declaration

```swift
func makeCommandBuffer() -> (any MTL4CommandBuffer)?
```

## Mentioned in

Understanding the Metal 4 core API

## Return Value

Return Value A MTL4CommandBuffer instance, or nil if the function failed.
