pub struct ResourceAliasingTracker { /* private fields */ }Expand description
Tracks resource aliasing: two logical resources that share the same physical memory (pool allocation) at non-overlapping lifetimes.
This is important for reducing peak GPU memory usage.
Implementations§
Source§impl ResourceAliasingTracker
impl ResourceAliasingTracker
Sourcepub fn track(
&mut self,
resource_name: impl Into<String>,
offset: usize,
size: usize,
)
pub fn track( &mut self, resource_name: impl Into<String>, offset: usize, size: usize, )
Record that resource_name uses physical allocation (offset, size).
Sourcepub fn aliases_for(&self, offset: usize, size: usize) -> &[String]
pub fn aliases_for(&self, offset: usize, size: usize) -> &[String]
Return all resource names sharing the physical allocation (offset, size).
Sourcepub fn are_aliased(&self, a: &str, b: &str) -> bool
pub fn are_aliased(&self, a: &str, b: &str) -> bool
Return true if two named resources share any physical allocation.
Sourcepub fn allocation_count(&self) -> usize
pub fn allocation_count(&self) -> usize
Total number of physical allocations tracked.
Sourcepub fn total_resource_registrations(&self) -> usize
pub fn total_resource_registrations(&self) -> usize
Total number of logical resource registrations across all allocations.
Trait Implementations§
Source§impl Debug for ResourceAliasingTracker
impl Debug for ResourceAliasingTracker
Source§impl Default for ResourceAliasingTracker
impl Default for ResourceAliasingTracker
Source§fn default() -> ResourceAliasingTracker
fn default() -> ResourceAliasingTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResourceAliasingTracker
impl RefUnwindSafe for ResourceAliasingTracker
impl Send for ResourceAliasingTracker
impl Sync for ResourceAliasingTracker
impl Unpin for ResourceAliasingTracker
impl UnsafeUnpin for ResourceAliasingTracker
impl UnwindSafe for ResourceAliasingTracker
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more