Contents

makeComputePipelineState(function:options:completionHandler:)

Asynchronously creates a compute pipeline state and reflection with a function instance.

Declaration

func makeComputePipelineState(function computeFunction: any MTLFunction, options: MTLPipelineOption, completionHandler: @escaping  @Sendable ((any MTLComputePipelineState)?, MTLComputePipelineReflection?, (any Error)?) -> Void)
func makeComputePipelineState(function computeFunction: any MTLFunction, options: MTLPipelineOption) async throws -> (any MTLComputePipelineState, MTLComputePipelineReflection?)

Parameters

  • computeFunction:

    An Mtlfunction instance.

  • options:

    An Mtlpipelineoption instance that represents the reflection information you want the method to generate.

  • completionHandler:

    A Swift closure or an Objective-C block the method calls when it finishes creating the compute pipeline state.

Discussion

Use the compute pipeline state to configure a compute pass by calling the setComputePipelineState(_:) method of an MTLComputeCommandEncoder instance.

See Also

Creating compute pipeline states