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 parallelRenderCommandEncoderWithDescriptor: 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

- renderCommandEncoder

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

Required.

Setting Render Pass State

- setColorStoreAction:atIndex:

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

Required.

- setColorStoreActionOptions:atIndex:

Specifies known store action options for a given color attachment.

Required.

- setDepthStoreAction:

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

Required.

- setDepthStoreActionOptions:

Specifies known store action options for a given depth attachment.

Required.

- setStencilStoreAction:

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

Required.

- setStencilStoreActionOptions:

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.

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software