Contents

LayerRenderer

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

Declaration

class LayerRenderer

Mentioned in

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

Getting the layer renderer properties

Getting the GPU device

Managing the rendering loop

Drawing a frame of content

Configuring the frame update rate

Defining quality level

Structures

Instance Properties

See Also

Render-loop setup