---
title: makeComputeCommandEncoder()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtl4commandbuffer/makecomputecommandencoder()
---

# makeComputeCommandEncoder()

Creates a compute command encoder.

## Declaration

```swift
func makeComputeCommandEncoder() -> (any MTL4ComputeCommandEncoder)?
```

## Return Value

Return Value The created MTL4ComputeCommandEncoder instance, or nil if the function fails.
