Contents

setVisibilityResultMode(_:offset:)

Configures a visibility test for Metal to run, and the destination for any results it generates.

Declaration

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

Parameters

  • mode:

    A Mtlvisibilityresultmode that configures which visibility test results the render pass saves to a buffer, or disables visibility testing.

  • offset:

    A location, in bytes, relative to the start of Visibilityresultbuffer The GPU stores the result of a visibility test at offset, which needs to be a multiple of 8.

Discussion

You use the mode parameter to enable or disable the visibility test, and determine if it produces a boolean response for passing fragments, or if it counts the number of fragments.