<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PostProcessEffect/prepare(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17PostProcessEffectP7prepare3forySo9MTLDevice_p_tF"
  },
  "title" : "prepare(for:)"
}
-->

# prepare(for:)

A method where you can prepare the metal device with initial setup work.

```
nonisolated mutating func prepare(for device: any MTLDevice)
```

## Discussion

When you set or update the [`customPostProcessing`](/documentation/RealityKit/RealityViewRenderingEffects/customPostProcessing) property,
RealityKit calls this method once, after it does its setup work,
but before rendering the next frame.

Adding long-running tasks in this method may cause rendering hitches.

---

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)