Class

MTLRenderPassDescriptor

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

Declaration

@interface MTLRenderPassDescriptor : NSObject

Overview

A MTLRenderPassDescriptor object contains a collection of attachments that are the rendering destination for pixels generated by a rendering pass. The MTLRenderPassDescriptor class is also used to set the destination buffer for visibility information generated by a rendering pass.

Topics

Creating a Default Render Pass Descriptor

+ renderPassDescriptor

Creates a default render pass descriptor.

Specifying the Attachments for a Rendering Pass

Setting Load and Store Actions

Set actions that define how a render pass loads and stores a render target.

colorAttachments

An array of state information for attachments that store color data.

depthAttachment

State information for an attachment that stores depth data.

stencilAttachment

State information for an attachment that stores stencil data.

MTLRenderPassAttachmentDescriptor

A render target that serves as the output destination for pixels generated by a render pass.

MTLRenderPassColorAttachmentDescriptor

A color render target that serves as the output destination for color pixels generated by a render pass.

MTLRenderPassDepthAttachmentDescriptor

A depth render target that serves as the output destination for depth pixels generated by a render pass.

MTLRenderPassStencilAttachmentDescriptor

A stencil render target that serves as the output destination for stencil pixels generated by a render pass.

Specifying the Visibility Result Buffer

visibilityResultBuffer

The destination for the GPU to write visibility information when samples pass the depth and stencil tests.

Layered Rendering

Rendering to Multiple Texture Slices in a Draw Command

Select a destination texture slice in your vertex shader.

renderTargetArrayLength

The number of active layers that all attachments must have for layered rendering.

renderTargetWidth

The width, in pixels, to constrain the render target to.

renderTargetHeight

The height, in pixels, to constrain the render target to.

Using Programmable Sample Positions

Positioning Samples Programmatically

Configure the position of samples when rendering to a multisampled render target.

Handling MSAA Depth with Programmable Sample Positions

Use depth render targets and programmable sample positions effectively.

MTLSamplePosition

A sample position on a subpixel grid.

MTLSamplePositionMake

Returns a new sample position on a subpixel grid.

- setSamplePositions:count:

Sets the programmable sample positions for a render pass.

- getSamplePositions:count:

Retrieves the programmable sample positions set for a render pass.

Specifying Tile Shading Parameters

imageblockSampleLength

The per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.

threadgroupMemoryLength

The per-tile size, in bytes, of the persistent threadgroup memory allocation.

tileWidth

The tile width, in pixels.

tileHeight

The tile height, in pixels.

Specifying Sample Counts

defaultRasterSampleCount

The raster sample count for the render pass when no attachments are given.

Specifying a Rasterization Rate Map

Rendering at Different Rasterization Rates

Configure a rasterization rate map to vary rasterization rates depending on the amount of detail needed.

rasterizationRateMap

The rasterization rate map to use when executing the render pass.

MTLRasterizationRateMapDescriptor

An object that you use to configure new rasterization rate maps.

MTLRasterizationRateMap

A compiled read-only object that determines how to apply variable rasterization rates when rendering.

Relationships

Inherits From

Conforms To

See Also

Rendering

Creating and Sampling Textures

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

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.

MTLRenderCommandEncoder

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

MTLParallelRenderCommandEncoder

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

Model I/O

Specify precise locations within the textures associated with graphics processing.

Presentation Objects

Use user interface elements to display your Metal content.