pub struct LodGpuCache { /* private fields */ }Expand description
Backend-neutral GPU residency ledger with deterministic LRU eviction.
Implementations§
Source§impl LodGpuCache
impl LodGpuCache
Sourcepub fn try_new(budgets: LodBudgets) -> LodResult<Self>
pub fn try_new(budgets: LodBudgets) -> LodResult<Self>
Creates an empty bounded cache.
Sourcepub fn resident_ids(&self) -> BTreeSet<NodeId>
pub fn resident_ids(&self) -> BTreeSet<NodeId>
Current resident IDs.
Sourcepub fn resident(&self, id: NodeId) -> Option<&ResidentNode>
pub fn resident(&self, id: NodeId) -> Option<&ResidentNode>
Finds a resident.
Sourcepub fn touch(&mut self, id: NodeId, generation: u64) -> LodResult<()>
pub fn touch(&mut self, id: NodeId, generation: u64) -> LodResult<()>
Marks a resident as used by generation.
Sourcepub fn admit(
&mut self,
id: NodeId,
point_count: u64,
gpu_bytes: u64,
generation: u64,
protected: &BTreeSet<NodeId>,
) -> LodResult<GpuCacheReceipt>
pub fn admit( &mut self, id: NodeId, point_count: u64, gpu_bytes: u64, generation: u64, protected: &BTreeSet<NodeId>, ) -> LodResult<GpuCacheReceipt>
Admits a completed explicit upload, evicting only unprotected LRU nodes.
Failure leaves the cache unchanged.
Sourcepub fn remove(&mut self, id: NodeId) -> Option<ResidentNode>
pub fn remove(&mut self, id: NodeId) -> Option<ResidentNode>
Explicitly removes a node.
Trait Implementations§
Source§impl Clone for LodGpuCache
impl Clone for LodGpuCache
Source§fn clone(&self) -> LodGpuCache
fn clone(&self) -> LodGpuCache
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 moreAuto Trait Implementations§
impl Freeze for LodGpuCache
impl RefUnwindSafe for LodGpuCache
impl Send for LodGpuCache
impl Sync for LodGpuCache
impl Unpin for LodGpuCache
impl UnsafeUnpin for LodGpuCache
impl UnwindSafe for LodGpuCache
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