<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ComputeGraphResource",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit",
      "ComputeGraph"
    ],
    "preciseIdentifier" : "s:24_RealityKit_ComputeGraph0cD8ResourceC"
  },
  "title" : "ComputeGraphResource"
}
-->

# ComputeGraphResource

A loaded compute graph resource containing the graph definition, compiled
pipelines, and all associated rendering assets.

```
final class ComputeGraphResource
```

## Overview

Load a `ComputeGraphResource` from a file URL using
[`init(contentsOf:bundle:)`](/documentation/RealityKit/ComputeGraphResource/init(contentsOf:bundle:)), then assign it to a
[`resource`](/documentation/RealityKit/ComputeGraphComponent/resource) to drive a simulation.

```swift
let resource = try await ComputeGraphResource(contentsOf: url)
var component = ComputeGraphComponent(resource: resource)
entity.components.set(component)
```

## Topics

### Structures

[`struct BufferInfo`](/documentation/RealityKit/ComputeGraphResource/BufferInfo)

[`struct Dependencies`](/documentation/RealityKit/ComputeGraphResource/Dependencies)

### Initializers

[`convenience init(contentsOf: URL) async throws`](/documentation/RealityKit/ComputeGraphResource/init(contentsOf:))

[`convenience init(contentsOf: URL, bundle: Bundle?) async throws`](/documentation/RealityKit/ComputeGraphResource/init(contentsOf:bundle:))

[`convenience init(graph: ComputeNodeGraph, pipelines: ComputeNodeGraph.Pipelines, dependencies: ComputeGraphResource.Dependencies) throws`](/documentation/RealityKit/ComputeGraphResource/init(graph:pipelines:dependencies:))

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)