Trait vulkano::memory::pool::MemoryPool
[−]
[src]
pub unsafe trait MemoryPool: 'static + Send + Sync { type Alloc: MemoryPoolAlloc; fn alloc(&self, ty: MemoryType, size: usize, alignment: usize, layout: AllocLayout) -> Result<Self::Alloc, OomError>; }
Pool of GPU-visible memory that can be allocated from.
Associated Types
type Alloc: MemoryPoolAlloc
Object that represents a single allocation. Its destructor should free the chunk.
Required Methods
fn alloc(&self, ty: MemoryType, size: usize, alignment: usize, layout: AllocLayout) -> Result<Self::Alloc, OomError>
Allocates memory from the pool.
Safety
- The returned object must match the requirements.
- When a linear object is allocated next to an optimal object, it is mandatory that
the boundary is aligned to the value of the
buffer_image_granularity
limit.
Panic
- Panics if
memory_type
doesn't belong to the same physical device as the device which was used to create this pool. - Panics if
size
is 0. - Panics if
alignment
is 0.
Implementors
impl MemoryPool for Arc<StdMemoryPool>