Instance Method

parallelRenderCommandEncoderWithDescriptor:

Creates an object that can split the work of encoding commands for a single render pass.

Required.

Declaration

- (id<MTLParallelRenderCommandEncoder>)parallelRenderCommandEncoderWithDescriptor:(MTLRenderPassDescriptor *)renderPassDescriptor;

Parameters

renderPassDescriptor

A collection of attachments and associated state for the graphics output of the rendering commands.

Return Value

A parallel rendering command encoder object.

Discussion

In some cases, your app’s performance can be limited by the single-CPU workload of encoding commands for a single rendering pass. However, attempting to circumvent this bottleneck by separating the workload into multiple rendering passes encoded on multiple CPU threads can also adversely impact performance, because each rendering pass requires its own intermediate attachment store and load actions to preserve the render target contents.

Use a MTLParallelRenderCommandEncoder to create multiple independent MTLRenderCommandEncoder objects that encode rendering commands for the same render pass. The parallel render command encoder ensures that the attachment load and store actions occur only at the start and end of the entire rendering pass, not at the start and end of each subordinate render command encoder’s set of commands.

See Also

Creating Command Encoders

- renderCommandEncoderWithDescriptor:

Creates an object to encode a rendering pass into the command buffer.

Required.

- computeCommandEncoderWithDispatchType:

Creates an object to encode a compute pass into the command buffer.

Required.

- computeCommandEncoder

Creates an object to encode a sequential compute pass into the command buffer.

Required.

- blitCommandEncoder

Creates an object to encode a block information transfer (blit) pass into the command buffer.

Required.

MTLDispatchType

Constants indicating how the compute command encoder's commands are dispatched.