<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/command-encoder-factory-methods",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Command encoder factory methods"
}
-->

# Command encoder factory methods

A command encoder defines the actions of a single pass, such as GPU commands that draw, compute, or quickly copy resource data.

## Topics

### Creating render encoders

A render encoder creates a render pass that draws graphics with a GPU.

[`makeRenderCommandEncoder(descriptor:)`](/documentation/Metal/MTLCommandBuffer/makeRenderCommandEncoder(descriptor:))

Creates a render command encoder from a descriptor.

### Creating parallel render encoders

A parallel render encoder creates multiple render encoders that all contribute to a single render pass that draws graphics with a GPU.

[`makeParallelRenderCommandEncoder(descriptor:)`](/documentation/Metal/MTLCommandBuffer/makeParallelRenderCommandEncoder(descriptor:))

Creates a parallel render command encoder from a descriptor.

### Creating acceleration structure encoders

An acceleration structure encoder creates a pass that builds or refits data for ray tracing with a GPU.

[`makeAccelerationStructureCommandEncoder(descriptor:)`](/documentation/Metal/MTLCommandBuffer/makeAccelerationStructureCommandEncoder(descriptor:))

Creates a ray-tracing acceleration structure command encoder from a descriptor.

[`makeAccelerationStructureCommandEncoder()`](/documentation/Metal/MTLCommandBuffer/makeAccelerationStructureCommandEncoder())

Creates a ray-tracing acceleration structure command encoder that uses default settings.

### Creating compute encoders

A compute encoder creates a pass that runs computations in parallel with the GPU.

[`makeComputeCommandEncoder(descriptor:)`](/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder(descriptor:))

Creates a compute command encoder from a descriptor.

[`makeComputeCommandEncoder()`](/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder())

Creates a compute command encoder that uses default settings.

[`makeComputeCommandEncoder(dispatchType:)`](/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder(dispatchType:))

Creates a compute command encoder with a dispatch type.

[`MTLDispatchType`](/documentation/Metal/MTLDispatchType)

The type of dispatch method to use when calling encoded functions.

### Creating blit encoders

A block information transfer (blit) encoder creates a pass that quickly copies data between GPU resources, including buffers and textures.

[`makeBlitCommandEncoder()`](/documentation/Metal/MTLCommandBuffer/makeBlitCommandEncoder())

Creates a block information transfer (blit) encoder.

[`makeBlitCommandEncoder(descriptor:)`](/documentation/Metal/MTLCommandBuffer/makeBlitCommandEncoder(descriptor:))

Creates a block information transfer (blit) encoder from a descriptor.

### Creating resource state encoders

A resource state encoder creates a pass that manages memory for sparse textures.

[`resourceStateCommandEncoder(with:)`](/documentation/Metal/MTLCommandBuffer/resourceStateCommandEncoder(with:))

Creates a resource state command encoder from a descriptor.

[`makeResourceStateCommandEncoder()`](/documentation/Metal/MTLCommandBuffer/makeResourceStateCommandEncoder())

Creates a resource state command encoder that uses default settings.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)