---
title: "makeCommandAllocator(descriptor:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/makecommandallocator(descriptor:)"
---

# makeCommandAllocator(descriptor:)

Creates a new command allocator from a command allocator descriptor.

## Declaration

```swift
func makeCommandAllocator(descriptor: MTL4CommandAllocatorDescriptor) throws -> any MTL4CommandAllocator
```

## Parameters

- `descriptor`: A doc://com.apple.metal/documentation/Metal/MTL4CommandAllocatorDescriptor instance that configures the doc://com.apple.metal/documentation/Metal/MTL4CommandAllocator instance.

## Return Value

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