Trait draw2d::graphics::vulkan::device_allocator::DeviceAllocator[][src]

pub trait DeviceAllocator {
    unsafe fn allocate(
        &mut self,
        allocate_info: MemoryAllocateInfo
    ) -> Result<Allocation>;
unsafe fn free(&mut self, allocation: &Allocation) -> Result<()>; }
Expand description

The external device memory allocation interface. This is the api used by applications to allocate and free memory on the gpu.

Required methods

Allocate device memory with the provided type index and size.

unsafe because

  • it is the responsibility of the caller to free the returned memory when it is no longer in use
  • implementations do not generally check that the memory type index in allocate_info is the correct memory type index, the arguments are assumed to be correct

Free an allocated piece of device memory.

unsafe because

  • it is the responsibility of the caller to know when the GPU is no longer using the allocation

Implementors