---
title: LayerRenderer.Frame
framework: compositorservices
role: symbol
role_heading: Structure
path: compositorservices/layerrenderer/frame
---

# LayerRenderer.Frame

A type that provides access to the timing information and data types you need to render a single frame of content.

## Declaration

```swift
struct Frame
```

## Overview

Overview A frame represents a snapshot of your app’s content at a single moment in time. In your rendering loop, you render your content into static images many times a second to create the illusion of animation. A LayerRenderer.Frame provides the Metal textures and information you need to render one of those images. During each iteration of your app’s rendering loop, call queryNextFrame() to retrieve the next frame to render. The system manages a finite number of frames and recycles them to maximize efficiency. You typically draw only one frame at a time, starting work on each new frame only after completing the previous frame. Separate the work you do for each frame into two phases: the update phase and the encode phase. Use the update phase to perform tasks that don’t depend on the current device pose. For example, you might update your app’s data structures to reflect recent interactions with your content. Use the submission phase to retrieve the current pose and render the frame’s content using that information. Each frame provides a LayerRenderer.Drawable type with access to the specific textures and rendering details for that frame.

## Topics

### Getting timing information

- [predictTiming()](compositorservices/layerrenderer/frame/predicttiming().md)
- [LayerRenderer.Frame.Timing](compositorservices/layerrenderer/frame/timing.md)

### Reporting frame update times

- [startUpdate()](compositorservices/layerrenderer/frame/startupdate().md)
- [endUpdate()](compositorservices/layerrenderer/frame/endupdate().md)

### Getting the drawable environment

- [queryDrawables()](compositorservices/layerrenderer/frame/querydrawables().md)
- [queryDrawable()](compositorservices/layerrenderer/frame/querydrawable().md)

### Reporting frame submission times

- [startSubmission()](compositorservices/layerrenderer/frame/startsubmission().md)
- [endSubmission()](compositorservices/layerrenderer/frame/endsubmission().md)

### Getting frame-related details

- [frameIndex](compositorservices/layerrenderer/frame/frameindex.md)
- [LayerFrameIndex](compositorservices/layerframeindex.md)
- [CompositorFrameIndex](compositorservices/compositorframeindex.md)

### Creating a frame

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

### Instance Methods

- [binocularFrustumMatrix(convention:increaseTangents:depthRange:)](compositorservices/layerrenderer/frame/binocularfrustummatrix(convention:increasetangents:depthrange:).md)
- [binocularFrustumMatrixForDrawableTarget(drawableTarget:convention:increaseTangents:depthRange:)](compositorservices/layerrenderer/frame/binocularfrustummatrixfordrawabletarget(drawabletarget:convention:increasetangents:depthrange:).md)
- [drawableTargetViewCount(target:)](compositorservices/layerrenderer/frame/drawabletargetviewcount(target:).md)
- [monocularFrustumMatrix(convention:viewIndex:increaseTangents:depthRange:)](compositorservices/layerrenderer/frame/monocularfrustummatrix(convention:viewindex:increasetangents:depthrange:).md)
- [monocularFrustumMatrixForDrawableTarget(drawableTarget:convention:viewIndex:increaseTangents:depthRange:)](compositorservices/layerrenderer/frame/monocularfrustummatrixfordrawabletarget(drawabletarget:convention:viewindex:increasetangents:depthrange:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)

## See Also

### Render-loop setup

- [LayerRenderer](compositorservices/layerrenderer.md)
