Skip to main content

RenderLimits

Struct RenderLimits 

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

Configurable CPU extraction and presentation limits for the first slice.

All values are fixed before the application starts. Zero per-kind limits are valid. The world Scene command budget limits circles, rectangles, and nonzero lines together. Screen rectangles use a separate ScreenScene budget; the desktop compositor applies FrameLimits to their combined presentation.

Implementations§

Source§

impl RenderLimits

Source

pub const fn new( max_world_circles: usize, world_scene_budget: SceneBudget, frame_limits: FrameLimits, ) -> Self

Creates limits with an explicit world circle cap and default remaining caps.

Use RenderLimits::with_max_world_rectangles and RenderLimits::with_max_world_lines to replace those caps without changing this source-compatible constructor. Screen rectangles start with DEFAULT_MAX_SCREEN_RECTANGLES and DEFAULT_SCREEN_SCENE_BUDGET.

Source

pub const fn screen_scene_reuse(self) -> bool

Whether exact validated screen snapshots/sub-runs may be reused on CPU. Enabled by default; independent of desktop GPU retention and interpolation.

Source

pub const fn with_screen_scene_reuse(self, enabled: bool) -> Self

Disables/enables CPU screen reuse for diagnostics with the same budgets. Disabled mode reconstructs scenes without relaxing any checks. This does not disable native Prepared/Compact retention or change rendered semantics.

Source

pub const fn max_world_circles(self) -> usize

Returns the maximum number of extracted world circles.

Source

pub const fn max_world_rectangles(self) -> usize

Returns the maximum number of extracted world rectangles.

Source

pub const fn max_world_lines(self) -> usize

Returns the maximum number of enabled managed line sources inspected.

Zero-vector sources count toward this limit even though they emit no resolved record or Scene command.

Source

pub const fn max_screen_rectangles(self) -> usize

Returns the maximum number of enabled managed screen rectangles extracted.

Source

pub const fn max_screen_lines(self) -> usize

Returns the maximum screen-line source count; default 256, including empty clips.

Source

pub const fn max_screen_circles(self) -> usize

Returns the maximum screen-circle source count; default 256, including empty clips.

Source

pub const fn max_screen_polylines(self) -> usize

Returns the enabled open-path count limit (256 by default), including hidden clips.

Source

pub const fn with_max_screen_polylines(self, count: usize) -> Self

Sets the open-path count limit independently of line/circle limits.

Source

pub const fn max_screen_polyline_points(self) -> usize

Returns the total enabled path-point limit (65,536 by default), including hidden clips and shared paths counted once for each occurrence.

Source

pub const fn with_max_screen_polyline_points(self, count: usize) -> Self

Sets aggregate open-path points inspected per frame, separate from the SceneBudget charged for visible commands/points and per-path construction.

Source

pub const fn with_max_screen_lines(self, count: usize) -> Self

Sets the screen-line count limit independently of shared scene work/byte limits.

Source

pub const fn with_max_screen_circles(self, count: usize) -> Self

Sets the screen-circle count limit independently of shared scene work/byte limits.

Source

pub const fn max_screen_images(self) -> usize

Returns the enabled screen-image count limit (zero by default).

Source

pub const fn max_screen_texts(self) -> usize

Returns the enabled screen-text source count limit, zero by default.

Source

pub const fn max_screen_text_bytes(self) -> usize

Returns the aggregate UTF-8 byte allowance for one screen-text snapshot.

Each enabled visual counts its complete string, even when several share the same prepared text. This is a work limit, not a retained-memory cap.

Source

pub const fn max_screen_text_glyphs(self) -> usize

Returns the aggregate shaped-glyph allowance for screen text.

Each enabled visual counts its prepared glyphs, including whitespace. Multiple placements of one shared string each consume this allowance.

Source

pub const fn with_max_screen_texts(self, limit: usize) -> Self

Enables a bounded number of screen labels without changing other caps.

Text is disabled by default. Also set the text byte and glyph allowances and desktop frame limits for glyph draws and font-atlas texture storage.

Source

pub const fn with_max_screen_text_bytes(self, limit: usize) -> Self

Replaces only the aggregate screen-text UTF-8 byte allowance.

Zero permits empty strings only; text source and glyph caps still apply.

Source

pub const fn with_max_screen_text_glyphs(self, limit: usize) -> Self

Replaces only the aggregate screen-text shaped-glyph allowance.

Zero permits labels with no shaped glyphs; it does not disable their source count or UTF-8 byte checks.

Source

pub const fn three_d(self) -> ThreeDRenderLimits

Returns opt-in object, triangle, and physical-target caps for real 3D.

Source

pub const fn with_three_d_render_limits( self, limits: ThreeDRenderLimits, ) -> Self

Replaces only the independent 3D prepass limits.

Final target composition also needs a pass and color texture allowance in FrameLimits. The default zero limits do not enable 3D rendering.

Source

pub const fn with_max_screen_images(self, limit: usize) -> Self

Enables a bounded number of screen images without changing other limits.

The default is zero. Also configure FrameLimits with texture storage and enough passes for images interleaved with rectangle runs. Each image initially uses one compositor source; this is not an atlas-batch API.

Source

pub const fn with_frame_limits(self, limits: FrameLimits) -> Self

Replaces only aggregate presentation limits, preserving source/Scene caps.

Source

pub const fn with_max_world_rectangles(self, limit: usize) -> Self

Replaces the rectangle staging limit without changing other budgets.

Zero is valid and disables managed rectangle extraction. The Scene command budget still limits the combined primitive count.

Source

pub const fn with_max_world_lines(self, limit: usize) -> Self

Replaces the line-source staging limit without changing other budgets.

Zero is valid and disables managed line extraction. The Scene command budget still limits all nonzero primitives together.

Source

pub const fn with_max_screen_rectangles(self, limit: usize) -> Self

Replaces the screen rectangle staging cap without changing other limits.

Zero disables screen rectangle extraction. The screen Scene command budget may impose a smaller cap independently.

Source

pub const fn with_screen_scene_budget(self, budget: SceneBudget) -> Self

Replaces the logical-screen Scene budget without changing other limits.

Zero budget fields are valid and are enforced during extraction. This does not change the desktop compositor’s aggregate FrameLimits.

Source

pub const fn world_scene_budget(self) -> SceneBudget

Returns the budget applied to the world-space Scene.

Source

pub const fn screen_scene_budget(self) -> SceneBudget

Returns the bounded work allowance for the logical-screen ScreenScene.

Source

pub const fn frame_limits(self) -> FrameLimits

Returns renderer-independent limits for one composed frame.

Trait Implementations§

Source§

impl Clone for RenderLimits

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RenderLimits

Source§

impl Debug for RenderLimits

Source§

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

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

impl Default for RenderLimits

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RenderLimits

Source§

impl PartialEq for RenderLimits

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RenderLimits

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynEq for T
where T: Any + Eq,

Source§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

Source§

type Template = T

The Template for this type.
Source§

impl<T> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

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

Source§

impl<T> Template for T
where T: Clone + Default + Unpin,

Source§

type Output = T

The type of value produced by this Template.
Source§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a Template::Output.
Source§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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> Upcast<T> for T

Source§

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WorldEvent for T
where T: Copy + Send + Sync + 'static,