Class

MTLRenderPipelineColorAttachmentDescriptor

A color render target that specifies the color configuration and color operations associated with a render pipeline.

Declaration

@interface MTLRenderPipelineColorAttachmentDescriptor : NSObject

Overview

A MTLRenderPipelineColorAttachmentDescriptor object defines the configuration of a color attachment associated with a rendering pipeline.

The pixelFormat property must be specified for the rendering pipeline state at the color attachment.

Blend operations determine how a source fragment is combined with a destination value in a color attachment to determine the pixel value to be written. The following properties define whether and how blending is performed:

Topics

Specifying Render Pipeline State

pixelFormat

The pixel format of the color attachment’s texture.

writeMask

A bitmask that restricts which color channels are written into the texture.

Controlling the Blend Operation

blendingEnabled

A Boolean value that determines whether blending is enabled.

alphaBlendOperation

The blend operation assigned for the alpha data.

rgbBlendOperation

The blend operation assigned for the RGB data.

Specifying Blend Factors

destinationAlphaBlendFactor

The destination blend factor (DBF) used by the alpha blend operation.

destinationRGBBlendFactor

The destination blend factor (DBF) used by the RGB blend operation.

sourceAlphaBlendFactor

The source blend factor (SBF) used by the alpha blend operation.

sourceRGBBlendFactor

The source blend factor (SBF) used by the RGB blend operation.

Constants

MTLBlendOperation

For every pixel, MTLBlendOperation determines how to combine and weight the source fragment values with the destination values. Some blend operations multiply the source values by a source blend factor (SBF), multiply the destination values by a destination blend factor (DBF), and then combine the results using addition or subtraction. Other blend operations use either a minimum or maximum function to determine the result.

MTLBlendFactor

The source and destination blend factors are often needed to complete specification of a blend operation. In most cases, the blend factor for both RGB values (F(rgb)) and alpha values (F(a)) are similar to one another, but in some cases, such as MTLBlendFactorSourceAlphaSaturated, the blend factor is slightly different. Four blend factors (MTLBlendFactorBlendColor, MTLBlendFactorOneMinusBlendColor, MTLBlendFactorBlendAlpha, and MTLBlendFactorOneMinusBlendAlpha) refer to a constant blend color value that is set by the setBlendColorRed:green:blue:alpha: method of MTLRenderCommandEncoder.

MTLColorWriteMask

Values used to specify a mask to permit or restrict writing to color channels of a color value. The values MTLColorWriteMaskRed, MTLColorWriteMaskGreen, MTLColorWriteMaskBlue, and MTLColorWriteMaskAlpha select one color channel each, and they can be bitwise combined.

Relationships

Inherits From

Conforms To

See Also

Specifying Rendering Pipeline State

- reset

Specifies the default rendering pipeline state values for the descriptor.

colorAttachments

An array of attachments that store color data.

depthAttachmentPixelFormat

The pixel format of the attachment that stores depth data.

stencilAttachmentPixelFormat

The pixel format of the attachment that stores stencil data.