---
title: "makeIntersectionFunction(descriptor:completionHandler:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtllibrary/makeintersectionfunction(descriptor:completionhandler:)"
---

# makeIntersectionFunction(descriptor:completionHandler:)

Asynchronously creates an object representing a ray-tracing intersection function, using the specified descriptor.

## Declaration

```swift
func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor, completionHandler: @escaping @Sendable ((any MTLFunction)?, (any Error)?) -> Void)
```

```swift
func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> any MTLFunction
```

## See Also

### Creating intersection function instances

- [makeIntersectionFunction(descriptor:)](metal/mtllibrary/makeintersectionfunction(descriptor:).md)
