---
title: "prepare(for:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/postprocesseffect/prepare(for:)"
---

# prepare(for:)

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

## Declaration

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

## Discussion

Discussion When you set or update the 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.
