Skip to main content

resolve_chains

Function resolve_chains 

Source
pub fn resolve_chains<I: ChainInput, R: ResolvedChain>(
    commands: Commands<'_, '_>,
    registry: Res<'_, FilterRegistry>,
    assets: Res<'_, AssetServer>,
    dirt: ResMut<'_, LayerContentDirt>,
    roots: Query<'_, '_, (Entity, &RNode, Ref<'_, I>, Ref<'_, PromotedLayer>, Option<&mut R>, &ComputedNode)>,
    unset: RemovedComponents<'_, '_, I>,
    stale: Query<'_, '_, (), With<R>>,
)
Expand description

Turn each promoted root’s wire chain input I into a packed resolved chain R. Two instances run in Update after the interaction restyle (the last input writer this frame) and before the transition/animation appliers — both write onto the resolved chain: the content instance (FilterInputResolvedFilterChain, the filter style) and the backdrop instance (BackdropInputResolvedBackdropChain, the backdropFilter style — see crate::filters::backdrop).

Re-resolves when the input changed, the node was (re-)promoted, or the node’s scale factor no longer matches the one baked into the existing chain. Per the plan’s identity-fallback rule, an unknown filter name (ChainInput::KIND_UNKNOWN) or rejected params (ChainInput::KIND_PARAMS) warn into [crate::diag] under the node’s scope and skip that entry; a chain with no valid entries attaches no resolved component at all (the node stays promoted — promotion reads the wire chain).

Writes are compare-before-write: an identical re-resolve neither bumps version nor produces dirt; a real change bumps it and pushes the root into LayerContentDirt::composite_only (filter output changes never dirty the capture — it holds unfiltered content, and a backdrop touches only pixels behind the node).