Skip to main content

Module record

Module record 

Source
Expand description

Recording rendering commands.

Vello CPU and Vello Hybrid share a recording stage before their pipelines diverge. Their pipelines can be split into roughly three parts:

  1. Record rendering commands into a scene-graph-like structure.
  2. Turn the complete recording into renderer-specific work. Vello CPU buckets commands by strip row, while Vello Hybrid schedules draws and layer operations across intermediate textures and render passes.
  3. Execute that work using CPU fine rasterization or GPU render passes, respectively.

The reasons for completing the recording before renderer-specific planning differ somewhat between the two renderers:

  • Vello CPU can inline regular layers with blends, opacity, masks, or clips into their parent command stream. However, filter layers must instead be rendered separately because spatial filters might sample neighboring pixels. The complete layer must be rendered before the filter can be applied and its result composited into the parent.

  • Vello Hybrid needs to render every layer separately. Its scheduler therefore needs the complete layer hierarchy and bounds before it can allocate intermediate textures and order draws, filters, and composition operations.

  • In both renderers, filter layers might have different dimensions than the main viewport. A large blur, for example, might require rendering shapes that would normally be culled because they exceed the viewport.

The recording stage allows us to serialize the whole scene into a graph that is enrichened with metadata, allowing each renderer to “do their own thing” while providing a common intermediate representation.

Structs§

CommandRecorder
Recorder for a scene description.
LayerClip
Clip path associated with a recorded layer.
LayerProps
Properties for a recorded layer.
Node
A node in the recorded render graph.
OpenLayer 🔒
RecordedLayer
Metadata and child nodes for a recorded layer.

Enums§

PoppedLayer
Kind of layer returned by CommandRecorder::pop_layer.
RecordedLayerKind
Additional metadata for regular and filter layers.

Traits§

Drawable
A drawable object that can report its bounding box.

Functions§

snapped_scene_size 🔒