<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/cp_layer_renderer_t",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Compositor Services"
    ],
    "preciseIdentifier" : "c:@T@cp_layer_renderer_t"
  },
  "title" : "cp_layer_renderer_t"
}
-->

# cp_layer_renderer_t

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

```
typedef CP_OBJECT_cp_layer_renderer * cp_layer_renderer_t;
```

## Discussion

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`](/documentation/CompositorServices/CompositorLayer) content,
the system creates a [`LayerRenderer`](/documentation/CompositorServices/LayerRenderer) type and makes it available to the content’s closure.
Use the information in the layer to set up your app’s rendering loop,
and to start drawing frames of content.

Each layer 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 of your layer as needed.
Specify your custom configuration details using the
[`CompositorLayerConfiguration`](/documentation/CompositorServices/CompositorLayerConfiguration) protocol and pass a type with those details to
the initializer for your immersive space’s content .
Use the layer’s capability information to validate any configuration choices you make.

For information about how to create and configure a layer and use it to run your rendering loop,
see [Drawing fully immersive content using Metal](/documentation/CompositorServices/drawing-fully-immersive-content-using-metal).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)