Skip to main content

FrameChunk

Struct FrameChunk 

Source
pub struct FrameChunk { /* private fields */ }
Expand description

One frame of one render target: the arena, primitives, mesh stream and draw calls every player sharing the target appends to, in its order.

Implementations§

Source§

impl FrameChunk

Source

pub fn stencil_enabled(&self) -> bool

Whether the hardware stencil is in use for the target this is built for.

Source

pub fn mask_backend(&self) -> MaskBackend

How the target this is built for draws masks.

crate::SSPlayer’s walk reads this rather than Self::stencil_enabled: planning writers, skipping a pure mask’s colour and testing a masked target are the same work for both backends, and only what the batch is appended as differs.

Source

pub fn set_node_coverage( &mut self, node: &mut NodeSlot, uv: &[f32; 6], extent: (f32, f32), writers: &[ScopedWriter], )

Attach the player’s coverage block to its top node, once the whole tree’s writers are planned.

uv is the affine that takes a player-local point to coverage UV [0,1] — the bbox normalisation, as [a, b, c, d, tx, ty] for u = a*x + c*y + tx, v = b*x + d*y + ty. Both the bake (which turns UV into clip space) and the replay (which samples with it) read this one transform, so the two cannot disagree about where the bitmap is.

Source

pub fn inherit_node_coverage( &mut self, node: &mut NodeSlot, uv: &[f32; 6], layer: u32, writers: &[ScopedWriter], )

Point a sub-animation at its player’s bitmap.

No new layer: the child reads the one bitmap the top node baked, and the same writer records — their scopes are on the tree sequence, which the whole tree shares. Only the affine differs, composed with the chain of instance placements so the child’s own local coordinates land in the top node’s coverage.

Source

pub fn node_coverage_layer(&self, node: &NodeSlot) -> u32

Which layer a node’s coverage went to, for pointing the rest of its tree at it.

Source

pub fn push_transform(&mut self, transform: &[f32; 16]) -> NodeSlot

Copy a placement matrix into the arena, for a top node that is no crowd: before any of its primitives, and the draws after it are issued once.

Source

pub fn append_batch( &mut self, renderer: &SSRenderer, frame: &FrameView<'_>, node: &NodeSlot, batch: &BatchInfo, )

Append one Normal, Mesh or Shape DrawBatch’s geometry to the frame. The vertices are copied as the runtime laid them out; node names the placement the vertex stage applies to them (the root’s, or an instance child’s composed with its parents’). frame is re-parsed for its draw_order/parts/parts_color; the batch fields are passed in so the caller (SSPlayer) drives batch iteration and can interleave instance recursion at the right rank. batch.stencil selects the stencil-test content pipeline for masked parts.

Source

pub fn append_mask_writer( &mut self, frame: &FrameView<'_>, node: &NodeSlot, writer: &MaskWriter, op: MaskOp, )

Append one mask writer’s geometry, routed to the mask-write pipeline for op. The cutout threshold rides in the primitive’s rate slot, which fs_mask reads as varg.x: it needs the full f32 range, including the -1 that means “no cutout”. No-op if masking is disabled.

Source

pub fn append_coverage_writer( &mut self, frame: &FrameView<'_>, node: &NodeSlot, writer: &MaskWriter, bit: usize, )

Rasterise one writer’s shape into the coverage bitmap, setting bit.

Called once per writer per frame — there is no add/remove interleave here, because the coverage backend does not carry a running state through the draw walk. What the stencil path spends passes replaying, the replay shader recomputes per fragment from the writer’s rank.

Source

pub fn append_effect( &mut self, plan_buf: &[u8], node: &NodeSlot, stencil: StencilTest, mask_seq: u32, alpha: f32, tint: u32, keys: &AtlasKeys, )

Append an effect slot’s EffectDrawPlan (a raw FlatBuffer) to the frame. node names the effect part’s composed placement (the vertices are slot-relative), and keys translates the plan’s cellmap hashes into renderer texture keys. Blend is per-command; color is taken from the plan and modulates the cellmap texture via the sprite shader. stencil selects the stencil test when the effect is a masked target (inherited from a parent mask); None for ordinary effects. alpha and tint are the player-level fade and colour (see BatchInfo::alpha and BatchInfo::tint).

Under the coverage backend a masked effect tests like any other part: node carries the coverage block, pulled back to the effect’s own local space, and mask_seq is the emitter’s place on the tree sequence.

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
§

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

§

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

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

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.

§

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

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

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

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,