pub struct ParticleRenderBudget { /* private fields */ }Expand description
Hard steady-state per-field limits for bounding particle visualization.
Atomic replacement temporarily retains the old and fully prepared new state together. Its CPU/GPU peak is therefore bounded by the sum of the old and new budgets, while every committed field stays within its own budget.
Implementations§
Source§impl ParticleRenderBudget
impl ParticleRenderBudget
Sourcepub const INSTANCE_BYTES: usize
pub const INSTANCE_BYTES: usize
Bytes used by one retained or visibility-staging particle slot.
Sourcepub fn new(
max_visible_instances: usize,
max_retained_bytes: usize,
max_gpu_bytes: usize,
max_upload_bytes_per_frame: usize,
) -> Result<Self, ParticleBudgetError>
pub fn new( max_visible_instances: usize, max_retained_bytes: usize, max_gpu_bytes: usize, max_upload_bytes_per_frame: usize, ) -> Result<Self, ParticleBudgetError>
Creates explicit visible-instance, retained-CPU, GPU-memory, and per-frame upload caps.
Sourcepub fn with_max_visibility_checks(
self,
max_visibility_checks_per_frame: usize,
) -> Result<Self, ParticleBudgetError>
pub fn with_max_visibility_checks( self, max_visibility_checks_per_frame: usize, ) -> Result<Self, ParticleBudgetError>
Caps camera visibility checks while sampling candidates uniformly across the retained field. The cap must fit the effective visible-instance cap.
Sourcepub const fn max_visible_instances(self) -> usize
pub const fn max_visible_instances(self) -> usize
Returns the maximum camera-visible instances considered for drawing.
Sourcepub const fn max_retained_bytes(self) -> usize
pub const fn max_retained_bytes(self) -> usize
Returns the maximum steady-state engine-owned particle allocation in bytes.
Sourcepub const fn max_gpu_bytes(self) -> usize
pub const fn max_gpu_bytes(self) -> usize
Returns the maximum particle instance-buffer allocation in bytes.
Sourcepub const fn max_upload_bytes_per_frame(self) -> usize
pub const fn max_upload_bytes_per_frame(self) -> usize
Returns the maximum particle bytes uploaded by one render call.
Sourcepub const fn max_visibility_checks_per_frame(self) -> usize
pub const fn max_visibility_checks_per_frame(self) -> usize
Returns the maximum retained instances checked against the viewport.
Trait Implementations§
Source§impl Clone for ParticleRenderBudget
impl Clone for ParticleRenderBudget
Source§fn clone(&self) -> ParticleRenderBudget
fn clone(&self) -> ParticleRenderBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ParticleRenderBudget
Source§impl Debug for ParticleRenderBudget
impl Debug for ParticleRenderBudget
Source§impl Default for ParticleRenderBudget
impl Default for ParticleRenderBudget
impl Eq for ParticleRenderBudget
Source§impl PartialEq for ParticleRenderBudget
impl PartialEq for ParticleRenderBudget
impl StructuralPartialEq for ParticleRenderBudget
Auto Trait Implementations§
impl Freeze for ParticleRenderBudget
impl RefUnwindSafe for ParticleRenderBudget
impl Send for ParticleRenderBudget
impl Sync for ParticleRenderBudget
impl Unpin for ParticleRenderBudget
impl UnsafeUnpin for ParticleRenderBudget
impl UnwindSafe for ParticleRenderBudget
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.