Skip to main content

CompiledFrame

Struct CompiledFrame 

Source
pub struct CompiledFrame {
Show 22 fields pub strips: StripStorage, pub recorder: CommandRecorder<EngineDraw>, pub encoded_paints: Vec<EncodedPaint>, pub clears: Vec<ClearPunch>, pub lut_requests: Vec<LutRequest>, pub fast_rect_draws: u32, pub scissor_clips: u32, pub mask_clips: u32, pub image_evictions: Vec<AtlasRegion>, pub image_uploads: Vec<ImageUpload>, pub atlas_layers: u32, pub image_draws: u32, pub skipped_images: u32, pub external_draws: u32, pub skipped_externals: u32, pub clip_mask_strips: usize, pub glyph_draws: u32, pub skipped_glyphs: u32, pub atlas_glyph_draws: u32, pub glyph_slots: Vec<GlyphSlot>, pub glyph_clears: Vec<PendingClearRect>, pub compile_spans: CompileSpans,
}
Expand description

Everything one compiled frame produced.

The strips and their alpha coverage share one StripStorage: strips.strips is the frame’s whole strip buffer (each EngineDraw::strip_range indexes into it) and strips.alphas the alpha runs those strips reference. They are kept together because a strip’s packed alpha index is only meaningful against the alpha buffer generated alongside it.

The draws themselves live in recorder.draws rather than in a field of their own: CommandRecorder already owns that vector, and its node ranges index into it, so a second parallel copy could only drift out of agreement with the recording. Read them through CompiledFrame::draws.

Fields§

§strips: StripStorage

The frame’s strips and the alpha coverage they index.

§recorder: CommandRecorder<EngineDraw>

The recorded render graph, owning the frame’s draws.

§encoded_paints: Vec<EncodedPaint>

Paints too complex to inline into a draw, indexed by Paint::Indexed.

§clears: Vec<ClearPunch>

The frame’s hole punches, hoisted to the root and issued at the punch’s own painter-order position (see clear).

Deliberately not draws: a punch erases rather than paints, and keeping it out of the recording is what lets a target that disregards alpha drop the whole pass and read the frame unchanged.

§lut_requests: Vec<LutRequest>

The colour ramps encoded_paints needs made resident before the frame is drawn, one per gradient entry.

Deliberately not serviced here: the compiler holds no gradient cache, so ramp residency is decided once per frame by the renderer rather than per draw by the walk (see paint).

§fast_rect_draws: u32

How many of this frame’s draws wrote their strip coverage directly as a rectangle, bypassing flattening and tiling (see [fast_rect]).

Purely observational — nothing downstream branches on it. It exists so the fast path’s admission rule is measurable from outside the compiler rather than inferred from a strip count that both paths can produce.

§scissor_clips: u32

How many of this frame’s clips lowered to a scissor rectangle, costing no rasterization at all (see clip).

§mask_clips: u32

How many of this frame’s clips lowered to a coverage mask.

§image_evictions: Vec<AtlasRegion>

Atlas regions whose texels must be cleared before this frame draws, freed by the residency reap at the head of the frame.

Serviced before image_uploads: a rectangle freed this frame can be re-allocated in the same frame, so clearing after writing would erase the image that just moved in.

§image_uploads: Vec<ImageUpload>

Atlas regions whose texels must be written before this frame draws, one per image that became resident during it.

Empty in the steady state: an image drawn on a thousand consecutive frames appears here exactly once, on the first.

§atlas_layers: u32

The atlas array depth this frame’s paints address — the layer count the array texture must have grown to before the uploads are written.

§image_draws: u32

How many of this frame’s draws painted with an atlas-backed image.

§skipped_images: u32

How many image draws were dropped because the image could not be made resident (unsupported format, oversized, malformed, atlas full, the same blob already resolved this frame at another extent, or the atlas disabled outright).

Observational, and the counter that makes “an image the engine cannot hold is a skipped draw, not a panicked frame” measurable rather than asserted.

§external_draws: u32

How many of this frame’s draws painted with an externally bound texture.

§skipped_externals: u32

How many external-texture draws were dropped — an id nothing is registered under, or a destination the texture cannot be mapped onto.

Observational, and the external counterpart of skipped_images: “a texture the engine cannot resolve is a skipped draw, not a wrongly-sampled one”, measured rather than asserted.

§clip_mask_strips: usize

How many strips this frame’s coverage masks cost.

Observational, and the counter the clip lowering’s whole claim rests on: a frame whose clips all scissored reports zero here, which is what “a rectangular clip is free” means measured rather than asserted.

§glyph_draws: u32

How many of this frame’s draws painted one glyph outline.

A glyph run costs one draw per glyph that produced coverage, so this is bounded by — and usually below — the run’s own glyph count: a glyph clipped away or carrying no ink (a space) records nothing.

§skipped_glyphs: u32

How many glyphs were dropped because the engine has no way to paint them on this path — a colour (COLR) glyph, a bitmap-strike glyph, or a stroked outline.

Observational, and the counter that makes “a glyph the engine cannot paint goes missing rather than landing wrong” measurable rather than asserted, the same way skipped_images does for images.

§atlas_glyph_draws: u32

How many of glyph_draws sampled the glyph atlas rather than rasterizing an outline.

The measure of what the policy is actually buying: a page of settled text reads all-atlas, an animating size reads zero, and the difference between them is the frame’s rasterization work.

Observational only. It is not the signal for whether the atlas has pixel work outstanding — a run whose draws were all culled still inserted entries and dirtied a page while reporting zero here. That question is SceneCompiler::glyph_replay_pending’s.

§glyph_slots: Vec<GlyphSlot>

Where each of this frame’s atlas-sampled glyphs lives, one entry per atlas draw (see GlyphSlot).

§glyph_clears: Vec<PendingClearRect>

Atlas rectangles freed by the previous frame’s glyph eviction, to be zeroed before this frame writes anything into the array.

Carried a frame late deliberately: glifo evicts at the end of a frame, and a rectangle it frees can be handed straight back out on the next one, so clearing it after that frame’s uploads and replay would erase whatever just moved in. Same ordering, same reason, as image_evictions.

Reported rather than consumed, on the same terms as image_evictions: the same rectangles appear on every later frame until a caller that really wrote them calls SceneCompiler::acknowledge_glyph_clears. A frame compiled and then refused takes none of them with it.

§compile_spans: CompileSpans

What compiling this frame cost, phase by phase — all zero without perf-trace (see CompileSpans).

Carried on the frame rather than kept on the compiler because the consumer is the renderer’s own encode-phase accounting, which already holds the frame and would otherwise have to reach back into the compiler for a number belonging to this frame alone.

Implementations§

Source§

impl CompiledFrame

Source

pub fn draws(&self) -> &[EngineDraw]

The frame’s draws, in paint order (back-most first).

Source

pub fn strip_buf(&self) -> &[Strip]

The frame’s whole strip buffer; a draw’s strip_range indexes into it.

Source

pub fn alphas(&self) -> &[u8] ⓘ

The alpha coverage the frame’s strips reference.

Trait Implementations§

Source§

impl Debug for CompiledFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,