<!--
{
  "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/MTLAccelerationStructure",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLAccelerationStructure"
  },
  "title" : "MTLAccelerationStructure"
}
-->

# MTLAccelerationStructure

A collection of model data for GPU-accelerated intersection of rays with the model.

```
protocol MTLAccelerationStructure : MTLResource
```

## Overview

To accelerate ray tracing, the device instance needs to reorganize your model data into an optimized data structure for intersection testing on that GPU. Create  [`MTLAccelerationStructure`](/documentation/Metal/MTLAccelerationStructure) instances to contain your model data and reference them in compute and render  commands that execute ray-tracing operations.

You don’t define classes that implement this protocol. To create an acceleration structure, you create a descriptor instance and configure its properties with your model data. Then call the [`makeAccelerationStructure(descriptor:)`](/documentation/Metal/MTLDevice/makeAccelerationStructure(descriptor:)) method on the Metal device instance to create the instance and reserve memory for the structure. To populate the structure with the data, use an [`MTLAccelerationStructureCommandEncoder`](/documentation/Metal/MTLAccelerationStructureCommandEncoder) to encode GPU commands.

Metal provides multiple descriptor classes, each describing a different type of model data. Choose the appropriate descriptor for each acceleration structure you want to make. Most often, you create an acceleration structure for each list of triangles or bounding boxes. Then collect related geometry structures into a primitive acceleration structure. Create instance acceleration structures when you need to reference instances of primitive acceleration structures at different locations within a scene.

The table below summarizes the descriptor classes:

|Descriptor class                                                                                   |Usage                                                                                                                                                              |
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|``doc://com.apple.metal/documentation/Metal/MTLAccelerationStructureTriangleGeometryDescriptor``   |Describes an acceleration structure for a list of triangles.                                                                                                       |
|``doc://com.apple.metal/documentation/Metal/MTLAccelerationStructureBoundingBoxGeometryDescriptor``|Describes an acceleration structure for a list of bounding boxes.                                                                                                  |
|``doc://com.apple.metal/documentation/Metal/MTLPrimitiveAccelerationStructureDescriptor``          |Describes an acceleration structure for a list of bounding-box or triangle acceleration structures, effectively creating a union of all of the underlying geometry.|
|``doc://com.apple.metal/documentation/Metal/MTLInstanceAccelerationStructureDescriptor``           |Describes an acceleration structure for a list of instances of primitive acceleration structures.                                                                  |

## Topics

### Reading the structure’s size

[`size`](/documentation/Metal/MTLAccelerationStructure/size)

The size of the acceleration structure’s memory allocation, in bytes.



---

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)