Protocol

MTLParallelRenderCommandEncoder

An object that splits up a single render pass so that 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

Rendering

Creating and Sampling Textures

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

Calculating Primitive Visibility Using Depth Testing

Determine which pixels are visible in a scene by using a depth texture.

Generating Multiple Output Vertex Streams from One Input Stream

Render efficiently to multiple layers or viewports.

Render Pipelines

Specify how graphics primitives should be rendered.

class MTLRenderPassDescriptor

A group of render targets that hold the results of a render pass.

protocol MTLRenderCommandEncoder

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

Model I/O

Specify precise locations within the textures associated with graphics processing.