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: boolWhether any main or isolated layer needs a stencil attachment.
Implementations§
Source§impl FrameRenderPlan
impl FrameRenderPlan
Sourcepub fn build_cpu(
layers: &[LayerPass<'_>],
prepared: &PreparedResources,
surface: [f32; 2],
scale: Scale,
stencil_supported: bool,
) -> Self
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());Sourcepub fn try_build_cpu(
layers: &[LayerPass<'_>],
prepared: &PreparedResources,
surface: [f32; 2],
scale: Scale,
stencil_supported: bool,
budget: &mut IsolatedBudgetPolicy,
) -> Result<Self, FramePlanError>
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);Sourcepub fn build_isolated_subplan(
layer: &LayerPass<'_>,
prepared: &PreparedResources,
iso: &PlannedIsolatedPass,
scale: Scale,
stencil_supported: bool,
) -> Self
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
impl Debug for FrameRenderPlan
Source§impl Default for FrameRenderPlan
impl Default for FrameRenderPlan
Source§fn default() -> FrameRenderPlan
fn default() -> FrameRenderPlan
Auto Trait Implementations§
impl Freeze for FrameRenderPlan
impl RefUnwindSafe for FrameRenderPlan
impl Send for FrameRenderPlan
impl Sync for FrameRenderPlan
impl Unpin for FrameRenderPlan
impl UnwindSafe for FrameRenderPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().