compat.vulkan-memory-allocator
AMD Vulkan Memory Allocator — device memory sub-allocation for Vulkan
mcpp add compat.vulkan-memory-allocator@3.4.0
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// 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 · 项目 tests/examples/vulkan-memory-allocator
构建
- targets
vulkan-memory-allocator (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include
源文件 (1)
mcpp_generated/vma_impl.cpp
生成的文件
mcpp_generated/vma_impl.cpp