Contents

makeFunction(descriptor:completionHandler:)

Asynchronously creates an object representing a shader function, using the specified descriptor.

Declaration

func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping  @Sendable ((any MTLFunction)?, (any Error)?) -> Void)
func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> any MTLFunction

Parameters

  • descriptor:

    The description of the function object to create.

  • completionHandler:

    A Swift closure or an Objective-C block that Metal calls after it creates the function.

See Also

Creating shader function instances