Struct FrameRenderPlan

Source
pub struct FrameRenderPlan {
Show 14 fields pub vertex_arena: Vec<Vertex>, pub rrect_vertex_arena: Vec<RRectVertex>, pub border_vertex_arena: Vec<BorderRRectVertex>, pub shadow_vertex_arena: Vec<BoxShadowVertex>, pub ring_progress_vertex_arena: Vec<RingProgressVertex>, pub stroke_vertex_arena: Vec<StrokeVertex>, pub tex_vertex_arena: Vec<TexVertex>, pub stencil_mask_arena: Vec<RRectVertex>, pub composite_vertex_arena: Vec<TexVertex>, pub layers: Vec<PlannedLayer>, pub batches: Vec<PlannedBatch>, pub planned_isolated: Vec<PlannedIsolatedPass>, pub backdrop_captures: Vec<BackdropCapturePoint>, pub needs_stencil_attachment: bool,
}
Expand description

Whole-frame plan. Single owner of the per-frame vertex arenas + batches.

§Examples

use ailloli_ui_render_wgpu::FrameRenderPlan;
let plan = FrameRenderPlan::default();
assert!(plan.layers.is_empty() && plan.batches.is_empty());

Fields§

§vertex_arena: Vec<Vertex>

Solid rectangle vertices.

§rrect_vertex_arena: Vec<RRectVertex>

Rounded-rectangle vertices.

§border_vertex_arena: Vec<BorderRRectVertex>

Rounded-border vertices.

§shadow_vertex_arena: Vec<BoxShadowVertex>

Box-shadow vertices.

§ring_progress_vertex_arena: Vec<RingProgressVertex>

Circular-progress vertices.

§stroke_vertex_arena: Vec<StrokeVertex>

Polyline vertices.

§tex_vertex_arena: Vec<TexVertex>

Text and image vertices.

§stencil_mask_arena: Vec<RRectVertex>

Rounded-mask vertices for stencil prepasses.

§composite_vertex_arena: Vec<TexVertex>

Quads for compositing isolated textures into the main pass.

§layers: Vec<PlannedLayer>

Layer state in input/main-pass order.

§batches: Vec<PlannedBatch>

Draw batches referenced by each layer’s batch_range.

§planned_isolated: Vec<PlannedIsolatedPass>

Offscreen passes scheduled for effects or blending.

§backdrop_captures: Vec<BackdropCapturePoint>

Ordered backdrop snapshots (increasing split_planned_layer_idx).

§needs_stencil_attachment: bool

Whether any main or isolated layer needs a stencil attachment.

Implementations§

Source§

impl FrameRenderPlan

Source

pub fn build_cpu( layers: &[LayerPass<'_>], prepared: &PreparedResources, surface: [f32; 2], scale: Scale, stencil_supported: bool, ) -> Self

Builds the frame plan from layer commands. Pure-CPU.

prepared provides the atlas/icon lookup; missing entries cause the corresponding glyph/icon to be skipped (same semantics as the legacy inline path).

stencil_supported is the only hardware/runtime configuration knob (still CPU-pure): when false, a layer that would normally use ClipRenderMode::Stencil is downgraded to ClipRenderMode::ShaderMask. This is the same downgrade that the legacy render_layer_pass path did inline.

§Panics

Panics with the FramePlanError debug representation when isolated planning fails. Use Self::try_build_cpu when failure is recoverable.

§Examples
use ailloli_ui_core::math::Scale;
use ailloli_ui_render_wgpu::{FrameRenderPlan, PreparedResources};
let plan = FrameRenderPlan::build_cpu(&[], &PreparedResources::default(),
    [800.0, 600.0], Scale::new(1.0), true);
assert!(plan.layers.is_empty());
Source

pub fn try_build_cpu( layers: &[LayerPass<'_>], prepared: &PreparedResources, surface: [f32; 2], scale: Scale, stencil_supported: bool, budget: &mut IsolatedBudgetPolicy, ) -> Result<Self, FramePlanError>

Builds a CPU-only plan using caller-owned per-frame budget state.

The budget is reset before planning. Missing prepared glyphs or icons are skipped. Geometry and surface are physical after applying scale; passing nonfinite or nonpositive extents violates renderer invariants.

§Errors

Returns an isolated-depth, empty-bounds, or pass-count error. A pass that exceeds only the aggregate byte budget is downgraded/skipped and recorded in budget rather than returned as an error.

§Examples
use ailloli_ui_core::math::Scale;
use ailloli_ui_render_wgpu::{FrameRenderPlan, IsolatedBudgetPolicy, PreparedResources};
let mut budget = IsolatedBudgetPolicy::with_defaults();
let plan = FrameRenderPlan::try_build_cpu(&[], &PreparedResources::default(),
    [1.0, 1.0], Scale::new(1.0), false, &mut budget)?;
assert!(!plan.needs_stencil_attachment);
Source

pub fn build_isolated_subplan( layer: &LayerPass<'_>, prepared: &PreparedResources, iso: &PlannedIsolatedPass, scale: Scale, stencil_supported: bool, ) -> Self

Builds a sub-plan for one isolated layer in local offscreen coordinates.

Geometry is translated by iso.content_origin_px; the local surface is iso.local_size_px. Stencil falls back to a shader mask when unsupported. This function plans only the supplied layer’s primitive batches and does not recursively schedule additional isolated passes.

§Examples
use ailloli_ui_core::math::Scale;
use ailloli_ui_render_wgpu::{FrameRenderPlan, LayerPass, PlannedIsolatedPass,
    PreparedResources};
fn subplan(layer: &LayerPass<'_>, isolated: &PlannedIsolatedPass) -> FrameRenderPlan {
    FrameRenderPlan::build_isolated_subplan(layer, &PreparedResources::default(),
        isolated, Scale::new(1.0), true)
}

Trait Implementations§

Source§

impl Debug for FrameRenderPlan

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for FrameRenderPlan

Source§

fn default() -> FrameRenderPlan

Returns the “default value” for a type. 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
§

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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>

§

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> ErasedDestructor for T
where T: 'static,

§

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

§

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,