Trait vulkano::memory::pool::MemoryPool [] [src]

pub unsafe trait MemoryPool {
    type Alloc: MemoryPoolAlloc;
    fn alloc(
        &self,
        ty: MemoryType,
        size: usize,
        alignment: usize,
        layout: AllocLayout
    ) -> Result<Self::Alloc, DeviceMemoryAllocError>; }

Pool of GPU-visible memory that can be allocated from.

Associated Types

Object that represents a single allocation. Its destructor should free the chunk.

Required Methods

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