mcpp index

compat.vulkan-memory-allocator

AMD Vulkan Memory Allocator — device memory sub-allocation for Vulkan

mcpp add compat.vulkan-memory-allocator@3.4.0

Usage

From this repository's own test project — built and run by CI, not written for the website.

// compat.vulkan-memory-allocator — drive VMA's VIRTUAL allocator.
//
// Everything else in VMA needs a VkDevice, which a CI runner with no GPU and no
// driver cannot create. The virtual allocator is the same sub-allocation
// algorithm with the Vulkan calls stripped out: it hands out offsets inside a
// notional block. That makes it the one part of VMA whose BEHAVIOUR can be
// asserted here -- and since it is compiled from the same VMA_IMPLEMENTATION
// TU as the rest, it still proves the package's implementation is built and
// linked (these symbols do not exist in the header-only view).
#include <vk_mem_alloc.h>
import std;

int main() {
    bool ok = true;
    auto check = [&](bool cond, std::string_view what) {
        if (!cond) {
            std::println("FAIL: {}", what);
            ok = false;
        }
    };

    constexpr VkDeviceSize BLOCK = 1u << 20;   // 1 MiB
// …

tests/examples/vulkan-memory-allocator/tests/virtual_block.cpp · project tests/examples/vulkan-memory-allocator

Build

targets
vulkan-memory-allocator (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

Sources (1)

  • mcpp_generated/vma_impl.cpp

Generated files

  • mcpp_generated/vma_impl.cpp

Versions

VersionPlatforms Mirrorssha256
3.4.0 latest LinuxWindowsmacOS GLOBAL CN 822aa850c6ce…