pub struct AssetEviction { /* private fields */ }Expand description
Direct GPU asset-cache maintenance service.
Evicts up to max_per_frame orphaned GPU asset entries each frame,
destroying their backing wgpu resources. Mirrors
EcsMaintenance for the GPU asset store:
budgeted, idempotent, and Data-owned.
Implementations§
Source§impl AssetEviction
impl AssetEviction
Sourcepub fn with_budget(max_per_frame: usize) -> Self
pub fn with_budget(max_per_frame: usize) -> Self
Creates a new eviction service with a custom per-frame budget.
Sourcepub fn tick(
&mut self,
store: &AssetStore,
world: &World,
device: &dyn GraphicsDevice,
)
pub fn tick( &mut self, store: &AssetStore, world: &World, device: &dyn GraphicsDevice, )
Runs one frame of eviction, sharing max_per_frame across materials
then meshes. Orphans beyond the budget stay cached for the next frame —
harmless, since an orphaned entry is simply not yet reclaimed.
Sourcepub fn last_evicted_count(&self) -> usize
pub fn last_evicted_count(&self) -> usize
Number of GPU assets evicted in the last tick.
Sourcepub fn max_per_frame(&self) -> usize
pub fn max_per_frame(&self) -> usize
The maximum number of GPU assets evicted per frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AssetEviction
impl RefUnwindSafe for AssetEviction
impl Send for AssetEviction
impl Sync for AssetEviction
impl Unpin for AssetEviction
impl UnsafeUnpin for AssetEviction
impl UnwindSafe for AssetEviction
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