Module frame_plan

Source
Expand description

single-pass compositing: CPU-pure frame render plan (vertex arenas + planned layers/batches). Frame render plan (single-pass compositing): pure CPU.

Given a frame’s layers + a PreparedResources snapshot, FrameRenderPlan::build_cpu produces:

  • vertex arenas (one Vec per primitive type, accumulated for the whole frame),
  • planned layers (scissor / stencil_ref / clip params / stencil mask range),
  • planned batches (pipeline + clip_bind + texture + vertex_range),
  • isolated offscreen passes + composite batches (isolated compositor).

No [wgpu::Device] / [wgpu::Queue] / crate::text::TextAtlas / crate::icons::IconCache access here. Tests can mock PreparedResources and call build_cpu without a GPU.

The plan guarantees:

  • arena ranges are stable for the whole frame (each batch has a Range<u32> into a buffer that is uploaded once via create_buffer_init),
  • batch fusion never crosses a layer boundary,
  • batch fusion requires identical pipeline + clip_bind + texture + adjacency.

Structs§

FrameRenderPlan
Whole-frame plan. Single owner of the per-frame vertex arenas + batches.
PlannedLayer
One scene layer’s GPU state snapshot inside the frame.

Enums§

ClipBindKind
Which clip uniform group a batch uses (bind group 0).
FramePlanError
CPU planning error for isolated passes.
PipelineKind
Which CPU/GPU pipeline a batch targets.
PlannedBatch
One draw call in the main or isolated plan.
TextureBindKind
Which texture bind group a batch uses (bind group 1).

Type Aliases§

IsolatedPass
Legacy alias: use PlannedIsolatedPass.