pub struct DedicatedAllocator { /* private fields */ }Expand description
Dedicated memory allocator that uses memory object per allocation requested.
This allocator suites best huge allocations. From 32 MiB when GPU has 4-8 GiB memory total.
Heaps use this allocator when none of sub-allocators bound to the memory type
can handle size required.
TODO: Check if resource prefers dedicated memory.
Implementations§
Source§impl DedicatedAllocator
impl DedicatedAllocator
Sourcepub fn new(
memory_type: MemoryTypeId,
memory_properties: Properties,
non_coherent_atom_size: Size,
) -> Self
pub fn new( memory_type: MemoryTypeId, memory_properties: Properties, non_coherent_atom_size: Size, ) -> Self
Create new DedicatedAllocator
for memory_type with memory_properties specified
Trait Implementations§
Source§impl<B: Backend> Allocator<B> for DedicatedAllocator
impl<B: Backend> Allocator<B> for DedicatedAllocator
Source§type Block = DedicatedBlock<B>
type Block = DedicatedBlock<B>
Block type returned by allocator.
Source§fn alloc(
&mut self,
device: &B::Device,
size: Size,
_align: Size,
) -> Result<(DedicatedBlock<B>, Size), AllocationError>
fn alloc( &mut self, device: &B::Device, size: Size, _align: Size, ) -> Result<(DedicatedBlock<B>, Size), AllocationError>
Allocate block of memory.
On success returns allocated block and amount of memory consumed from device.
Source§impl Debug for DedicatedAllocator
impl Debug for DedicatedAllocator
Auto Trait Implementations§
impl Freeze for DedicatedAllocator
impl RefUnwindSafe for DedicatedAllocator
impl Send for DedicatedAllocator
impl Sync for DedicatedAllocator
impl Unpin for DedicatedAllocator
impl UnwindSafe for DedicatedAllocator
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