---
title: LayerRenderer
framework: compositorservices
role: symbol
role_heading: Class
path: compositorservices/layerrenderer
---

# LayerRenderer

A type that provides the Metal types and timing information you need to draw your content.

## Declaration

```swift
class LayerRenderer
```

## Mentioned in

Drawing fully immersive content using Metal

## Overview

Overview A layer renderer type creates a bridge between a SwiftUI scene and the Metal code you use to draw fully immersive experiences. When you present an immersive space with CompositorLayer content, the system creates a LayerRenderer type and makes it available to the content’s closure. Use the information in the layer renderer to set up your app’s rendering loop, and to start drawing frames of content. Each layer renderer has information that tells the system how to configure the Metal textures and data types your app needs. Compositor Services provides a default configuration for layers, but you can customize the configuration as needed. Specify your custom configuration details using the CompositorLayerConfiguration protocol and pass a type with those details to the initializer for your immersive space’s content. Use the layer renderer’s capability information to validate any configuration choices you make. For information about how to create and configure a layer renderer and use it to run your rendering loop, see Drawing fully immersive content using Metal.

## Topics

### Configuring the layer renderer

- [configuration](compositorservices/layerrenderer/configuration-swift.property.md)
- [LayerRenderer.Configuration](compositorservices/layerrenderer/configuration-swift.struct.md)
- [LayerRenderer.Capabilities](compositorservices/layerrenderer/capabilities.md)

### Getting the layer renderer properties

- [properties](compositorservices/layerrenderer/properties-swift.property.md)
- [LayerRenderer.Properties](compositorservices/layerrenderer/properties-swift.struct.md)

### Getting the GPU device

- [device](compositorservices/layerrenderer/device.md)

### Managing the rendering loop

- [state](compositorservices/layerrenderer/state-swift.property.md)
- [waitUntilRunning()](compositorservices/layerrenderer/waituntilrunning().md)
- [LayerRenderer.State](compositorservices/layerrenderer/state-swift.enum.md)
- [LayerRenderer.Clock](compositorservices/layerrenderer/clock.md)

### Drawing a frame of content

- [queryNextFrame()](compositorservices/layerrenderer/querynextframe().md)
- [LayerRenderer.Frame](compositorservices/layerrenderer/frame.md)
- [LayerRenderer.Drawable](compositorservices/layerrenderer/drawable.md)

### Configuring the frame update rate

- [minimumFrameRepeatCount](compositorservices/layerrenderer/minimumframerepeatcount.md)

### Defining quality level

- [renderQuality](compositorservices/layerrenderer/renderquality-swift.property.md)
- [defaultRenderQuality](compositorservices/layerrenderer/capabilities/defaultrenderquality.md)
- [maxRenderQuality](compositorservices/layerrenderer/configuration-swift.struct/maxrenderquality.md)
- [Defining layer renderer quality](compositorservices/defining-layer-renderer-quality.md)

### Structures

- [LayerRenderer.RenderQuality](compositorservices/layerrenderer/renderquality-swift.struct.md)

### Instance Properties

- [commandQueue](compositorservices/layerrenderer/commandqueue.md)
- [onSpatialEvent](compositorservices/layerrenderer/onspatialevent-2jg60.md)
- [onSpatialEvent](compositorservices/layerrenderer/onspatialevent-inq8.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Render-loop setup

- [LayerRenderer.Frame](compositorservices/layerrenderer/frame.md)
