---
title: "init(device:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/lowlevelrendercontextstandalone/resources/init(device:)"
---

# init(device:)

Asynchronously compiles the shared shader and pipeline resources for the given device.

## Declaration

```swift
nonisolated(nonsending) init(device: any MTLDevice) async throws
```

## Parameters

- `device`: The Metal device to allocate and compile resources on.

## Discussion

Discussion note: An error if shader compilation fails.
