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.
Modulesยง
- allocator ๐
- block ๐
- buddy ๐
- config ๐
- error ๐
- freelist ๐
- heap ๐
- slab ๐
- usage ๐
- util ๐
Macrosยง
- report_error_on_drop ๐
Structsยง
- Allocation flags
- Configuration for
GpuAllocator
- Properties of the device that will be used for allocating memory objects.
- Memory allocator for Vulkan-like APIs.
- Specifies range of the mapped memory region.
- Memory block allocated by
GpuAllocator
. - Defines memory heap.
- Memory properties type.
- Defines memory type.
- Memory request for allocator.
- Memory usage type. Bits set define intended usage for requested memory.
Enumsยง
- Enumeration of possible errors that may occur during memory allocation.
- Hints for allocator to decide on allocation strategy.
- Memory mapped error.
- Enumeration of possible errors that may occur during memory mapping.
- Memory exhausted error.
Traitsยง
- Abstract device that can be used to allocate memory objects.
Functionsยง
- align_down ๐Align
value
down toalign_mask
Returns largest integer not bigger thanvalue
aligned byalign_mask
. - align_up ๐Aligns
value
up toalign_mask
Returns smallest integer not lesser thanvalue
aligned byalign_mask
. ReturnsNone
on overflow. - unreachable_unchecked ๐ โ