Instance Method

setVisibilityResultMode:offset:

Configures which visibility test the GPU executes and the destination for any results it generates.

Required.

Declaration

- (void)setVisibilityResultMode:(MTLVisibilityResultMode)mode offset:(NSUInteger)offset;

Parameters

mode

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

offset

The location within the visibility buffer where the GPU stores results for this test. The offset must be a multiple of 8 bytes.

Discussion

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

Call this method before each set of drawing commands that you want to monitor. 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 in the result buffer can only be used once during the render pass. You must encode all drawing commands for that location before setting a different offset.

By default, when you create the render command encoder, the testing mode is set to MTLVisibilityResultModeDisabled, which means the render pass does not track any visibility data.

See Also

Setting Visibility Behavior

MTLVisibilityResultMode

The mode that determines what, if anything, the GPU writes to the results buffer, after the GPU executes the render pass.