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
impl RenderLimits
Sourcepub const fn new(
max_world_circles: usize,
world_scene_budget: SceneBudget,
frame_limits: FrameLimits,
) -> Self
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.
Sourcepub const fn screen_scene_reuse(self) -> bool
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.
Sourcepub const fn with_screen_scene_reuse(self, enabled: bool) -> Self
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.
Sourcepub const fn max_world_circles(self) -> usize
pub const fn max_world_circles(self) -> usize
Returns the maximum number of extracted world circles.
Sourcepub const fn max_world_rectangles(self) -> usize
pub const fn max_world_rectangles(self) -> usize
Returns the maximum number of extracted world rectangles.
Sourcepub const fn max_world_lines(self) -> usize
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.
Sourcepub const fn max_screen_rectangles(self) -> usize
pub const fn max_screen_rectangles(self) -> usize
Returns the maximum number of enabled managed screen rectangles extracted.
Sourcepub const fn max_screen_lines(self) -> usize
pub const fn max_screen_lines(self) -> usize
Returns the maximum screen-line source count; default 256, including empty clips.
Sourcepub const fn max_screen_circles(self) -> usize
pub const fn max_screen_circles(self) -> usize
Returns the maximum screen-circle source count; default 256, including empty clips.
Sourcepub const fn max_screen_polylines(self) -> usize
pub const fn max_screen_polylines(self) -> usize
Returns the enabled open-path count limit (256 by default), including hidden clips.
Sourcepub const fn with_max_screen_polylines(self, count: usize) -> Self
pub const fn with_max_screen_polylines(self, count: usize) -> Self
Sets the open-path count limit independently of line/circle limits.
Sourcepub const fn max_screen_polyline_points(self) -> usize
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.
Sourcepub const fn with_max_screen_polyline_points(self, count: usize) -> Self
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.
Sourcepub const fn with_max_screen_lines(self, count: usize) -> Self
pub const fn with_max_screen_lines(self, count: usize) -> Self
Sets the screen-line count limit independently of shared scene work/byte limits.
Sourcepub const fn with_max_screen_circles(self, count: usize) -> Self
pub const fn with_max_screen_circles(self, count: usize) -> Self
Sets the screen-circle count limit independently of shared scene work/byte limits.
Sourcepub const fn max_screen_images(self) -> usize
pub const fn max_screen_images(self) -> usize
Returns the enabled screen-image count limit (zero by default).
Sourcepub const fn max_screen_texts(self) -> usize
pub const fn max_screen_texts(self) -> usize
Returns the enabled screen-text source count limit, zero by default.
Sourcepub const fn max_screen_text_bytes(self) -> usize
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.
Sourcepub const fn max_screen_text_glyphs(self) -> usize
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.
Sourcepub const fn with_max_screen_texts(self, limit: usize) -> Self
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.
Sourcepub const fn with_max_screen_text_bytes(self, limit: usize) -> Self
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.
Sourcepub const fn with_max_screen_text_glyphs(self, limit: usize) -> Self
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.
Sourcepub const fn three_d(self) -> ThreeDRenderLimits
pub const fn three_d(self) -> ThreeDRenderLimits
Returns opt-in object, triangle, and physical-target caps for real 3D.
Sourcepub const fn with_three_d_render_limits(
self,
limits: ThreeDRenderLimits,
) -> Self
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.
Sourcepub const fn with_max_screen_images(self, limit: usize) -> Self
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.
Sourcepub const fn with_frame_limits(self, limits: FrameLimits) -> Self
pub const fn with_frame_limits(self, limits: FrameLimits) -> Self
Replaces only aggregate presentation limits, preserving source/Scene caps.
Sourcepub const fn with_max_world_rectangles(self, limit: usize) -> Self
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.
Sourcepub const fn with_max_world_lines(self, limit: usize) -> Self
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.
Sourcepub const fn with_max_screen_rectangles(self, limit: usize) -> Self
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.
Sourcepub const fn with_screen_scene_budget(self, budget: SceneBudget) -> Self
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.
Sourcepub const fn world_scene_budget(self) -> SceneBudget
pub const fn world_scene_budget(self) -> SceneBudget
Returns the budget applied to the world-space Scene.
Sourcepub const fn screen_scene_budget(self) -> SceneBudget
pub const fn screen_scene_budget(self) -> SceneBudget
Returns the bounded work allowance for the logical-screen ScreenScene.
Sourcepub const fn frame_limits(self) -> FrameLimits
pub const fn frame_limits(self) -> FrameLimits
Returns renderer-independent limits for one composed frame.
Trait Implementations§
Source§impl Clone for RenderLimits
impl Clone for RenderLimits
impl Copy for RenderLimits
Source§impl Debug for RenderLimits
impl Debug for RenderLimits
Source§impl Default for RenderLimits
impl Default for RenderLimits
impl Eq for RenderLimits
Source§impl PartialEq for RenderLimits
impl PartialEq for RenderLimits
impl StructuralPartialEq for RenderLimits
Auto Trait Implementations§
impl Freeze for RenderLimits
impl RefUnwindSafe for RenderLimits
impl Send for RenderLimits
impl Sync for RenderLimits
impl Unpin for RenderLimits
impl UnsafeUnpin for RenderLimits
impl UnwindSafe for RenderLimits
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.