An argument of options you pass to a device to get a render pipeline state object.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
MTLRender object specifies the rendering configuration state used during a rendering pass, including rasterization (such as multisampling), visibility, blending, tessellation, and graphics function state. Use standard allocation and initialization techniques to create a
MTLRender object. A
MTLRender object is later used to create a
To specify the vertex or fragment function in the rendering pipeline descriptor, set the
fragment property, respectively, to the desired
MTLFunction object. Note that the properties in the Specifying Tessellation State section are ignored if the
vertex property is not set to a post-tessellation vertex function. A vertex function is a post-tessellation vertex function if the
[[ patch(patch-type, N) ]] attribute precedes the function’s signature in your Metal shading language source.
The properties in the Specifying Tessellation State section are only used if the
vertex property is set to a post-tessellation vertex function. A post-tessellation vertex function is a vertex function declared with the
[[ patch(patch-type, N) ]] attribute in your Metal shading language source. Refer to the Post-Tessellation Vertex Function section of the Metal Shading Language Guide for more information.
fragment property to
nil disables the rasterization of pixels into the color attachment. This action is typically used for outputting vertex function data into a buffer object or for depth-only rendering.
Multisampling and the Render Pipeline
If a color attachment supports multisampling (in effect, the attachment is a
MTLTexture type color texture), you can create multiple samples per fragment, and the following rendering pipeline descriptor properties determine coverage:
sampleis the number of samples for each pixel.
alphais set to
To Coverage Enabled
YES, then the alpha channel fragment output for
coloris used to compute a coverage mask that affects the values being written to all attachments (color, depth, and stencil).
alpha is set to
YES, an implementation-defined coverageToMask function uses the alpha channel fragment output from
color to create an intermediate coverage mask, which sets a number of bits in its output proportionally to the value of the floating point input. For example, if the input is
0, the function sets the output to
0x0. If the input is
1, all output bits are set (in effect,
~0x0). If the input is
0, the function sets half of the bits, as defined by the implementation (which often uses dither patterns).
To determine a final coverage mask, a logical AND is performed on the resulting coverage mask alphaCoverageMask with the masks from the rasterizer and fragment shader, as shown in Listing 1.