Instance Method


Controls how to monitor samples that pass the depth and stencil tests.



func setVisibilityResultMode(_ mode: MTLVisibilityResultMode, offset: Int)



The mode that determines what, if anything, is written to the visibility buffer.


The offset within the visibility buffer where the visibility result should be stored. Must be a multiple of 8 bytes.


To use visibility testing, your render pass descriptor must include a buffer in which to store results. See visibilityResultBuffer.

The encoder uses the new visibility mode and offset for future drawing commands encoded in this render pass, until you make another call to this method. A given offset can only be used once in any particular render command encoder. You must submit all commands for a given location in the visibility buffer before changing to another offset.

See Also

Setting Visibility Behavior

enum MTLVisibilityResultMode

The mode that determines whether samples pass the depth and stencil tests and whether to monitor the samples that pass.