Protocol

MTLParallelRenderCommandEncoder

An object that splits up a single render pass so it can be simultaneously encoded from multiple threads.

Declaration

protocol MTLParallelRenderCommandEncoder

Overview

Your app does not define classes that implement this protocol. To create a MTLParallelRenderCommandEncoder object, call the makeParallelRenderCommandEncoder(descriptor:) method of the MTLCommandBuffer object that you want to encode the rendering commands into. Then, call the renderCommandEncoder method on this MTLParallelRenderCommandEncoder object to create one or more MTLRenderCommandEncoder objects. The subordinate MTLRenderCommandEncoder objects created encode their commands to the same command buffer and target the same MTLRenderPassAttachmentDescriptor object. The MTLParallelRenderCommandEncoder object ensures the attachment load and store actions only occur at the start and end of the entire rendering pass.

You can assign each MTLRenderCommandEncoder to its own thread and each can encode commands in parallel. You are responsible for any thread synchronization that is required. After all the subordinate encoders have finished encoding their commands, call endEncoding() to execute the commands. The rendering commands are executed in the order that the subordinate encoders were created.

Topics

Creating a Render Command Encoder

func makeRenderCommandEncoder() -> MTLRenderCommandEncoder?

Create an object that encodes commands that perform graphics rendering operations and may be assigned to a different thread.

Required.

Setting Render Pass State

func setColorStoreAction(MTLStoreAction, index: Int)

Specifies a known store action to replace the initial MTLStoreAction.unknown value specified for a given color attachment.

Required.

func setColorStoreActionOptions(MTLStoreActionOptions, index: Int)

Specifies known store action options for a given color attachment.

Required.

func setDepthStoreAction(MTLStoreAction)

Specifies a known store action to replace the initial MTLStoreAction.unknown value specified for a given depth attachment.

Required.

func setDepthStoreActionOptions(MTLStoreActionOptions)

Specifies known store action options for a given depth attachment.

Required.

func setStencilStoreAction(MTLStoreAction)

Specifies a known store action to replace the initial MTLStoreAction.unknown value specified for a given stencil attachment.

Required.

func setStencilStoreActionOptions(MTLStoreActionOptions)

Specifies known store action options for a given stencil attachment.

Required.

Relationships

Inherits From

See Also

Graphics

Basic Buffers

Demonstrates how to manage hundreds of vertices with a vertex buffer.

Creating and Sampling Textures

Load image data into a texture and apply it to a quadrangle.

protocol MTLRenderCommandEncoder

The object to use for encoding commands for a render pass.

Render Pass

A collection of commands that updates a set of render targets.

Render Pipeline

A specification for how graphics primitives should be rendered.

Vertex Data

Points that specify precise locations within the textures associated with graphics processing.

Presentation Objects

Various user interface elements you use to display your Metal content onscreen.