Crate gpu_alloc

Source
Expand description

Implementation agnostic memory allocator for Vulkan like APIs.

This crate is intended to be used as part of safe API implementations.
Use with caution. There are unsafe functions all over the place.

§Usage

Start with fetching DeviceProperties from gpu-alloc-<backend> crate for the backend of choice.
Then create GpuAllocator instance and use it for all device memory allocations.
GpuAllocator will take care for all necessary bookkeeping like memory object count limit, heap budget and memory mapping.

§Backends implementations

Backend supporting crates should not depend on this crate.
Instead they should depend on gpu-alloc-types which is much more stable, allowing to upgrade gpu-alloc version without gpu-alloc-<backend> upgrade.

Structs§

AllocationFlags
Allocation flags
Config
Configuration for GpuAllocator
DeviceProperties
Properties of the device that will be used for allocating memory objects.
GpuAllocator
Memory allocator for Vulkan-like APIs.
MappedMemoryRange
Specifies range of the mapped memory region.
MemoryBlock
Memory block allocated by GpuAllocator.
MemoryHeap
Defines memory heap.
MemoryPropertyFlags
Memory properties type.
MemoryType
Defines memory type.
Request
Memory request for allocator.
UsageFlags
Memory usage type. Bits set define intended usage for requested memory.

Enums§

AllocationError
Enumeration of possible errors that may occur during memory allocation.
Dedicated
Hints for allocator to decide on allocation strategy.
DeviceMapError
Memory mapped error.
MapError
Enumeration of possible errors that may occur during memory mapping.
OutOfMemory
Memory exhausted error.

Traits§

MemoryDevice
Abstract device that can be used to allocate memory objects.