---
title: device
framework: scenekit
role: symbol
role_heading: Instance Property
path: scenekit/scnscenerenderer/device
---

# device

The Metal device this renderer uses for rendering.

## Declaration

```swift
var device: (any MTLDevice)? { get }
```

## Discussion

Discussion Use this property to create or look up other Metal resources that use the same device as your SceneKit renderer. note: This property is valid only for scene renderers whose renderingAPI value is SCNRenderingAPI.metal. You create a SceneKit view that renders using Metal with the preferredRenderingAPI initialization option or in Interface Builder, or an SCNRenderer that uses Metal with the init(device:options:) method. For OpenGL-based scene renderers, this property’s value is always nil.

## See Also

### Customizing Scene Rendering with Metal

- [currentRenderCommandEncoder](scenekit/scnscenerenderer/currentrendercommandencoder.md)
- [commandQueue](scenekit/scnscenerenderer/commandqueue.md)
- [colorPixelFormat](scenekit/scnscenerenderer/colorpixelformat.md)
- [depthPixelFormat](scenekit/scnscenerenderer/depthpixelformat.md)
- [stencilPixelFormat](scenekit/scnscenerenderer/stencilpixelformat.md)
