Expand description
Vulkan memory management as extension to nobs-vk.
Buffer and image creation in vulkan is tricky in comparison to e.g. OpenGL, because
- We have to create the buffer/image and then later bind it to a
vkDeviceMemory
that has to be created separately. - Creating a single
vkDeviceMemory
allocation for every buffer/image is bad practice, in fact it is encouraged to bind esources that are used together on the same allocation. - Another layer of difficulty is introduced with memory types, since not all resources (should) share the same memory properties - which is different for each Driver/Vendor
nobs-vkmem provides convenient and accessible methods for creating buffers and images and binding them to physical memory. This dramatically reduces boiler plate code, while still offers the user considerable control over how resources are bound to memory.
- Easy buffer and image creation with builder patterns.
- Device memory is allocated in larger pages. The library keeps track of free and used regions in a page.
- Offers different allocation strategies for different purposes, including forcing the binding of several resources to a continuous block, or binding resources on private pages.
- Easy mapping of host accessible buffers
Interfacing with this library is mainly handled in Allocator, with which buffers and images are bound to device memory.
Buffer and Image provide a convenient way to configure buffers/images and bind them to the allocator in bulk.
See Allocator to get a quick overview on how to use this library.
Structs§
- Allocator for buffer and image resources
- Defines meta information for the Allocator
- Bundles all information for the Allocator to perform a resource memory binding.
- Builder pattern for creating buffer resources
- Builder pattern for creating image resources
- A mapped memory region
- Generic builder for buffers and images
Enums§
- Strategy how resources are bound in the Allocator
- Errors that can be occure when using this crate
- Enum defining resource types that can be bound