<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIntersectionFunctionTable",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLIntersectionFunctionTable"
  },
  "title" : "MTLIntersectionFunctionTable"
}
-->

# MTLIntersectionFunctionTable

A table of intersection functions that Metal calls to perform ray-tracing intersection tests.

```
protocol MTLIntersectionFunctionTable : MTLResource
```

## Overview

Don’t implement this protocol yourself. Instead create an [`MTLIntersectionFunctionTableDescriptor`](/documentation/Metal/MTLIntersectionFunctionTableDescriptor) instance and configure its properties. Then call the appropriate method on the pipeline state that you want to use this table with:

- Compute pipeline: [`makeIntersectionFunctionTable(descriptor:)`](/documentation/Metal/MTLComputePipelineState/makeIntersectionFunctionTable(descriptor:))
- Render pipeline: [`makeIntersectionFunctionTable(descriptor:stage:)`](/documentation/Metal/MTLRenderPipelineState/makeIntersectionFunctionTable(descriptor:stage:))

If you use the same ray-tracing functions with more than one pipeline, make a separate table for each.

Use the methods on this instance to set the table entries to point at the intersection functions, and to provide buffers as arguments for those functions. For more information about intersection functions, see [Metal Shading Language Specification](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf).

## Topics

### Setting a table entry

[`setFunction(_:index:)`](/documentation/Metal/MTLIntersectionFunctionTable/setFunction(_:index:))

Sets an entry in the table.

[`setFunctions(_:range:)`](/documentation/Metal/MTLIntersectionFunctionTable/setFunctions(_:range:))

Sets a range of entries in the table.

[`setFunctions:withRange:`](/documentation/Metal/MTLIntersectionFunctionTable/setFunctions:withRange:)

Sets a range of entries in the table.

### Specifying arguments for intersection functions

[`setBuffer(_:offset:index:)`](/documentation/Metal/MTLIntersectionFunctionTable/setBuffer(_:offset:index:))

Sets a buffer for the intersection functions.

[`setBuffers(_:offsets:range:)`](/documentation/Metal/MTLIntersectionFunctionTable/setBuffers(_:offsets:range:))

Sets a range of buffers for the intersection functions.

[`setBuffers:offsets:withRange:`](/documentation/Metal/MTLIntersectionFunctionTable/setBuffers:offsets:withRange:)

Sets a range of buffers for the intersection functions.

[`setVisibleFunctionTable(_:bufferIndex:)`](/documentation/Metal/MTLIntersectionFunctionTable/setVisibleFunctionTable(_:bufferIndex:))

Sets a visible function table for the intersection functions.

[`setVisibleFunctionTables(_:bufferRange:)`](/documentation/Metal/MTLIntersectionFunctionTable/setVisibleFunctionTables(_:bufferRange:))

Sets a range of visible function tables for the intersection functions.

[`setVisibleFunctionTables:withBufferRange:`](/documentation/Metal/MTLIntersectionFunctionTable/setVisibleFunctionTables:withBufferRange:)

Sets a range of visible function tables for the intersection functions.

### Specifying opaque triangle intersection testing

[`setOpaqueTriangleIntersectionFunction(signature:index:)`](/documentation/Metal/MTLIntersectionFunctionTable/setOpaqueTriangleIntersectionFunction(signature:index:))

Sets an entry in the intersection table to point to a system-defined opaque triangle intersection function.

[`setOpaqueTriangleIntersectionFunction(signature:range:)`](/documentation/Metal/MTLIntersectionFunctionTable/setOpaqueTriangleIntersectionFunction(signature:range:))

Sets a range of entries in the intersection table to point to a system-defined opaque triangle intersection function.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)