---
title: "makeComputeCommandEncoder(dispatchType:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlcommandbuffer/makecomputecommandencoder(dispatchtype:)"
---

# makeComputeCommandEncoder(dispatchType:)

Creates a compute command encoder with a dispatch type.

## Declaration

```swift
func makeComputeCommandEncoder(dispatchType: MTLDispatchType) -> (any MTLComputeCommandEncoder)?
```

## Parameters

- `dispatchType`: An doc://com.apple.metal/documentation/Metal/MTLDispatchType instance that indicates whether the compute pass the encoder creates runs commands serially or concurrently.

## Discussion

Discussion Use an MTLComputeCommandEncoder instance’s methods to set up a single compute pass.

## See Also

### Creating compute encoders

- [makeComputeCommandEncoder(descriptor:)](metal/mtlcommandbuffer/makecomputecommandencoder(descriptor:).md)
- [makeComputeCommandEncoder()](metal/mtlcommandbuffer/makecomputecommandencoder().md)
- [MTLDispatchType](metal/mtldispatchtype.md)
