stencilCompareFunction
The comparison that is performed between the masked reference value and a masked value in the stencil attachment.
Declaration
var stencilCompareFunction: MTLCompareFunction { get set }Discussion
For example, if stencilCompareFunction is MTLCompareFunction.less, then the stencil test passes if the masked reference value is less than the masked stored stencil value. The default value is MTLCompareFunction.always, 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.