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 properties_required() -> Properties
pub fn properties_required() -> Properties
Get properties required by the allocator.
Sourcepub fn new(memory_type: MemoryTypeId, memory_properties: Properties) -> Self
pub fn new(memory_type: MemoryTypeId, memory_properties: Properties) -> Self
Create new LinearAllocator
for memory_type
with memory_properties
specified
Trait Implementations§
Source§impl<B> Allocator<B> for DedicatedAllocatorwhere
B: Backend,
impl<B> Allocator<B> for DedicatedAllocatorwhere
B: Backend,
Source§type Block = DedicatedBlock<B>
type Block = DedicatedBlock<B>
Block type returned by allocator.
Source§fn alloc(
&mut self,
device: &B::Device,
size: u64,
_align: u64,
) -> Result<(DedicatedBlock<B>, u64), AllocationError>
fn alloc( &mut self, device: &B::Device, size: u64, _align: u64, ) -> Result<(DedicatedBlock<B>, u64), 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