Struct gpu_alloc::GpuAllocator[][src]

pub struct GpuAllocator<M> { /* fields omitted */ }
Expand description

Memory allocator for Vulkan-like APIs.

Implementations

Creates new instance of GpuAllocator. Provided DeviceProperties should match propertices of MemoryDevice that will be used with created GpuAllocator instance.

Allocates memory block from specified device according to the request.

Safety

  • device must be one with DeviceProperties that were provided to create this GpuAllocator instance.
  • Same device instance must be used for all interactions with one GpuAllocator instance and memory blocks allocated from it.

Allocates memory block from specified device according to the request. This function allows user to force specific allocation strategy. Improper use can lead to suboptimal performance or too large overhead. Prefer GpuAllocator::alloc if doubt.

Safety

  • device must be one with DeviceProperties that were provided to create this GpuAllocator instance.
  • Same device instance must be used for all interactions with one GpuAllocator instance and memory blocks allocated from it.

Deallocates memory block previously allocated from this GpuAllocator instance.

Safety

  • Memory block must have been allocated by this GpuAllocator instance
  • device must be one with DeviceProperties that were provided to create this GpuAllocator instance
  • Same device instance must be used for all interactions with one GpuAllocator instance and memory blocks allocated from it

Deallocates leftover memory objects. Should be used before dropping.

Safety

  • device must be one with DeviceProperties that were provided to create this GpuAllocator instance
  • Same device instance must be used for all interactions with one GpuAllocator instance and memory blocks allocated from it

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.