Contents

LayerRenderer.Drawable

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

Declaration

struct Drawable

Mentioned in

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

Accessing the device orientation

Getting the render textures

Enqueueing a command buffer

Getting the rasterization rate map

Getting the projection matrix

Accessing pixel depth information

Managing the state machine

Synchronizing the drawing operation

Retrieving the target

Creating a drawable

Adding a render context

Structures

Instance Properties

Instance Methods

See Also

Drawing environment