Instance Property

stencilCompareFunction

The comparison that is performed between the masked reference value and a masked value in the stencil attachment.

Declaration

@property(nonatomic) MTLCompareFunction stencilCompareFunction;

Discussion

For example, if stencilCompareFunction is MTLCompareFunctionLess, then the stencil test passes if the masked reference value is less than the masked stored stencil value. The default value is MTLCompareFunctionAlways, which indicates that the stencil test always passes.

The stored stencil value and the reference value are both masked by performing a logical AND operation with the readMask value before the comparison takes place. For more information on possible values, see MTLCompareFunction.

See Also

Specifying Stencil Functions and Operations

stencilFailureOperation

The operation that is performed to update the values in the stencil attachment when the stencil test fails.

depthFailureOperation

The operation that is performed to update the values in the stencil attachment when the stencil test passes, but the depth test fails.

depthStencilPassOperation

The operation that is performed to update the values in the stencil attachment when both the stencil test and the depth test pass.

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