Contents

reflection

The compute pipeline’s reflection information, if available.

Declaration

var reflection: MTLComputePipelineReflection? { get }

Discussion

The property is nil by default to help reduce your app’s memory footprint, but you can create reflection information when your app needs it.

Create reflection information by building a pipeline from an MTL4Compiler instance with the following steps:

  1. Configure the shaderReflection property of an MTL4PipelineOptions instance.

  2. Assign that instance to the options property of an MTL4PipelineDescriptor instance.

  3. Create a compute pipeline state by passing that pipeline descriptor to one of the MTL4Compiler instance’s methods.

The property is nil when you create a pipeline state from anMTLDevice instance, such as with its makeComputePipelineState(descriptor:options:completionHandler:) method.