pub struct MemoryPool { /* private fields */ }Expand description
GPU memory pool for efficient buffer reuse.
This pool manages a large buffer and suballocates from it to avoid frequent GPU allocations.
Implementations§
Source§impl MemoryPool
impl MemoryPool
Sourcepub fn new(context: &GpuContext, config: MemoryPoolConfig) -> GpuResult<Self>
pub fn new(context: &GpuContext, config: MemoryPoolConfig) -> GpuResult<Self>
Sourcepub fn free(&mut self, allocation: MemoryAllocation) -> GpuResult<()>
pub fn free(&mut self, allocation: MemoryAllocation) -> GpuResult<()>
Sourcepub fn stats(&self) -> &MemoryStats
pub fn stats(&self) -> &MemoryStats
Get current memory statistics.
Sourcepub fn defragment(&mut self) -> GpuResult<()>
pub fn defragment(&mut self) -> GpuResult<()>
Auto Trait Implementations§
impl Freeze for MemoryPool
impl !RefUnwindSafe for MemoryPool
impl Send for MemoryPool
impl Sync for MemoryPool
impl Unpin for MemoryPool
impl UnsafeUnpin for MemoryPool
impl !UnwindSafe for MemoryPool
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