pub struct ParticleRenderBudget { /* private fields */ }Expand description
Hard per-field limits that keep particle visualization from starving a host simulation.
Implementations§
Source§impl ParticleRenderBudget
impl ParticleRenderBudget
Sourcepub fn new(
max_visible_instances: usize,
max_gpu_bytes: usize,
max_upload_bytes_per_frame: usize,
) -> Result<Self, ParticleBudgetError>
pub fn new( max_visible_instances: usize, max_gpu_bytes: usize, max_upload_bytes_per_frame: usize, ) -> Result<Self, ParticleBudgetError>
Creates explicit visible-instance, 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_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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.