GitHub - GPUOpen-LibrariesAndSDKs VulkanMemoryAllocator: Simple To Integrate Vulkan Memory Allocation Library

From TimeRO Wiki
Revision as of 20:40, 15 August 2025 by CarleyF698401704 (talk | contribs) (Created page with "<br>Easy to combine Vulkan memory allocation library. It requires quite a lot of boilerplate code, identical to everything else in Vulkan, as a result of it's a low-level and excessive-efficiency API. There may be extra degree of indirection: VkDeviceMemory is allocated individually from creating VkBuffer/VkImage and so they should be sure collectively. Driver must be queried for supported memory heaps and [https://wiki.ragnarok-infinitezero.com.br/index.php?title=User:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Easy to combine Vulkan memory allocation library. It requires quite a lot of boilerplate code, identical to everything else in Vulkan, as a result of it's a low-level and excessive-efficiency API. There may be extra degree of indirection: VkDeviceMemory is allocated individually from creating VkBuffer/VkImage and so they should be sure collectively. Driver must be queried for supported memory heaps and MemoryWave Community memory sorts. Different GPU vendors provide several types of it. It is recommended to allocate larger chunks of memory and assign elements of them to specific resources, as there is a restrict on maximum number of memory blocks that may be allotted. 1. Features that assist to choose appropriate and optimum memory sort based on intended usage of the memory. Required or most well-liked traits of the memory are expressed utilizing greater-stage description evaluating to Vulkan flags. Library keeps monitor of allocated memory blocks, used and unused ranges inside them, finds finest matching unused ranges for brand spanking new allocations, respects all the foundations of alignment and buffer/picture granularity.



3. Capabilities that may create an image/buffer, allocate memory for it and bind them collectively - all in one call. Properly-documented - description of all functions and MemoryWave Community constructions provided, together with chapters that contain normal description and instance code. Thread-safety: Library is designed to be utilized in multithreaded code. Access to a single gadget memory block referred by totally different buffers and textures (binding, mapping) is synchronized internally. Memory mapping is reference-counted. Configuration: Fill elective members of VmaAllocatorCreateInfo structure to offer customized CPU memory allocator, pointers to Vulkan functions and different parameters. Customization and integration with customized engines: Predefine appropriate macros to supply your personal implementation of all external amenities used by the library like assert, mutex, atomic. Help for memory mapping, reference-counted internally. Assist for persistently mapped memory: Just allocate with acceptable flag and entry the pointer to already mapped memory. Help for non-coherent memory. Features that flush/invalidate memory. CoherentAtomSize is respected robotically.



Assist for resource aliasing (overlap). Assist for sparse binding and sparse residency: Comfort functions that allocate or free a number of memory pages at once. Custom memory pools: Create a pool with desired parameters (e.g. fastened or restricted maximum measurement) and allocate memory out of it. Linear allocator: Create a pool with linear algorithm and use it for much quicker allocations and deallocations in free-at-once, stack, double stack, or ring buffer style. Just allow it and will probably be used routinely by the library. Used internally if available to query for current usage and finances. If not obtainable, it falls again to an estimation based mostly on memory heap sizes. KHR is routinely added to memory allocations the place needed. Set priority of allocations or custom swimming pools and it will likely be set routinely utilizing this extension. Public interface in C, in same convention as Vulkan API. Error handling implemented by returning VkResult error codes - identical manner as in Vulkan.



Interface documented using Doxygen-type feedback. Platform-independent, however developed and tested on Home windows using Visible Studio. Steady integration setup for Home windows and Linux. Used also on Android, MacOS, and other platforms. Fundamental utilization of this library is very simple. Superior options are optionally available. VkDeviceMemory block is allocated if needed. 1. An unused region of the memory block is certain to this buffer. VmaAllocation is an object that represents memory assigned to this buffer. It may be queried for parameters like VkDeviceMemory handle and offset. On Home windows it is suggested to make use of CMake GUI. This robotically handles configuring the embody listing. For extra info on utilizing CMake go to the official CMake documentation. The VulkanMemoryAllocator port in vcpkg is stored up to date by Microsoft team members and group contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository. The release comes with precompiled binary executable for "VulkanSample" utility which contains check suite. Vulkan Samples - official Khronos Vulkan samples.