---
title: LayerRenderer.Drawable
framework: compositorservices
role: symbol
role_heading: Structure
path: compositorservices/layerrenderer/drawable
---

# LayerRenderer.Drawable

A type that provides the textures and information you need to draw a frame of content.

## Declaration

```swift
struct Drawable
```

## Mentioned in

Drawing fully immersive content using Metal

## Overview

Overview When you draw a frame of content, the frame’s  LayerRenderer.Drawable type provides the actual textures and rendering information you need. Do as much work as possible in advance to prepare for rendering, and retrieve the LayerRenderer.Drawable only when you’re ready to start encoding commands into your Metal command buffers. The system recycles frames and their drawables for efficiency, so if you retrieve the drawable too early, it might not be ready to use. Use the drawable’s LayerRenderer.Drawable.View instances to determine where to draw your content in the provided textures. After you finish encoding your content, call encodePresent(commandBuffer:) to add a presentation notification to your command buffer. This command tells Compositor Services when to display the frame, and is essential for displaying your frame on time.

## Topics

### Getting the views

- [views](compositorservices/layerrenderer/drawable/views.md)
- [LayerRenderer.Drawable.View](compositorservices/layerrenderer/drawable/view.md)

### Accessing the device orientation

- [deviceAnchor](compositorservices/layerrenderer/drawable/deviceanchor.md)

### Getting the render textures

- [colorTextures](compositorservices/layerrenderer/drawable/colortextures.md)
- [depthTextures](compositorservices/layerrenderer/drawable/depthtextures.md)

### Enqueueing a command buffer

- [encodePresent(commandBuffer:)](compositorservices/layerrenderer/drawable/encodepresent(commandbuffer:).md)

### Getting the rasterization rate map

- [rasterizationRateMaps](compositorservices/layerrenderer/drawable/rasterizationratemaps.md)
- [flippedRasterizationRateMaps](compositorservices/layerrenderer/drawable/flippedrasterizationratemaps.md)

### Getting the projection matrix

- [AxisDirectionConvention](compositorservices/axisdirectionconvention.md)

### Accessing pixel depth information

- [depthRange](compositorservices/layerrenderer/drawable/depthrange.md)

### Managing the state machine

- [state](compositorservices/layerrenderer/drawable/state-swift.property.md)
- [LayerRenderer.Drawable.State](compositorservices/layerrenderer/drawable/state-swift.enum.md)

### Synchronizing the drawing operation

- [frameTiming](compositorservices/layerrenderer/drawable/frametiming.md)
- [presentationFrameIndex](compositorservices/layerrenderer/drawable/presentationframeindex.md)

### Retrieving the target

- [target](compositorservices/layerrenderer/drawable/target-swift.property.md)
- [LayerRenderer.Drawable.Target](compositorservices/layerrenderer/drawable/target-swift.enum.md)

### Creating a drawable

- [init()](compositorservices/layerrenderer/drawable/init().md)

### Adding a render context

- [LayerRenderer.Drawable.RenderContext](compositorservices/layerrenderer/drawable/rendercontext.md)
- [addRenderContext(commandBuffer:)](compositorservices/layerrenderer/drawable/addrendercontext(commandbuffer:).md)
- [addRenderContext()](compositorservices/layerrenderer/drawable/addrendercontext().md)

### Structures

- [LayerRenderer.Drawable.TrackingArea](compositorservices/layerrenderer/drawable/trackingarea.md)

### Instance Properties

- [isContentCaptureProtected](compositorservices/layerrenderer/drawable/iscontentcaptureprotected.md)
- [trackingAreasTextures](compositorservices/layerrenderer/drawable/trackingareastextures.md)

### Instance Methods

- [addTrackingArea(identifier:)](compositorservices/layerrenderer/drawable/addtrackingarea(identifier:).md)
- [computeProjection(convention:viewIndex:)](compositorservices/layerrenderer/drawable/computeprojection(convention:viewindex:).md)
- [encodePresent()](compositorservices/layerrenderer/drawable/encodepresent().md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)

## See Also

### Drawing environment

- [LayerRenderer.Drawable.View](compositorservices/layerrenderer/drawable/view.md)
