C++ bindings for VulkanMemoryAllocator

Overview

VulkanMemoryAllocator-Hpp

These bindings use all the handy stuff from Vulkan-Hpp: wrapper classes, type safe enums, std::vectors, Optional etc. They are generated by the generator used by Vulkan-Hpp, that's why they look so similar.

Current VMA version: 3.0.0-development (e5c03604c9740ff337cd0c5b4a19c9a04a0b3a52)

Warning: The bindings are not thoroughly tested yet. If you encounter any errors, please open an issue: https://github.com/malte-v/VulkanMemoryAllocator-Hpp/issues/new

Setup

Just copy vk_mem_alloc.h and vk_mem_alloc.hpp to your project.

Usage

// In *one* source file:
#define VMA_IMPLEMENTATION

// If you don't like the `vma::` prefix:
#define VMA_HPP_NAMESPACE <prefix>

#include "vk_mem_alloc.hpp"
Issues
  • Update to VMA 2.3.0

    Update to VMA 2.3.0

    Vulkan Memory Allocator is now at version 2.3.0-alpha.1. It's backward compatible, but there are many additions since 2.2.0. All new symbols are mentioned in CHANGELOG.md. You can update this project to use the new version.

    opened by adam-sawicki-a 7
  • Updated Vulkan Memory Allocator to Version 2_3.

    Updated Vulkan Memory Allocator to Version 2_3.

    Updated VMA to Version 2.3.0 as per changelog. Updated vulkan.hpp header to use Version 154. Tested with Visual Studio 16.7 with MSVC 19.27.29110 Used C++ latest standard (preview changes for C++20)

    Fixes: #3 Refer: VMA 2.3.0 Changelog

    opened by kidrigger 3
  • Added FlagTraits to fix compiler errors

    Added FlagTraits to fix compiler errors

    The ~ operator of the Flags<> template class in vulkan.hpp to flip the bits uses FlagTraits<BitType>::allFlags which is not defined for the vma related Flags types. So I added the FlagTraits for those types and added three string conversions as well which were missing.

    It's no big change but it should make the compiler errors regarding the operator use go away.

    opened by TheJackiMonster 2
  • Fix misinterpreted call to getBudget()

    Fix misinterpreted call to getBudget()

    vmaGetBudget() does not, in fact, take a single VmaBudget as an out parameter. Instead, it expects that to be an array of size memoryHeapCount.

    I will be submitting an issue to VMA proper about this as well, since before switching to VMA-HPP I made the same incorrect assumption, so I think the function is poorly named.

    In any event, this will correctly call vmaGetBudget(), by creating a vector of the correct size and then returning that.

    Without it you get this lovely stack corruption error, and at least on Visual Studio 2019, a full-on segfault.

    opened by WhoBrokeTheBuild 2
  • Header guards?

    Header guards?

    Is there any reason why there is no header guards in vk_mem_alloc.hpp? If not, I think it'd be nice to have them. Since vk_mem_alloc.h uses AMD_VULKAN_MEMORY_ALLOCATOR_H I suggest using AMD_VULKAN_MEMORY_ALLOCATOR_HPP or something similar.

    opened by gssgh 1
  • Not working after update on Arch

    Not working after update on Arch

    After trying to compile:

    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::AllocationCreateFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:108:45:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::AllocationCreateFlagBits>’
      719 |       return Flags<BitType>( m_mask ^ FlagTraits<BitType>::allFlags );
          |                                                            ^~~~~~~~
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::AllocatorCreateFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:169:44:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::AllocatorCreateFlagBits>’
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::DefragmentationFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:210:44:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::DefragmentationFlagBits>’
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::PoolCreateFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:251:39:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::PoolCreateFlagBits>’
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::RecordFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:288:35:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::RecordFlagBits>’
    In file included from /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:5,
                     from /home/ashley/Programming/zombie-hunter/src/main/main.cpp:2:
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::AllocationCreateFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:108:45:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::AllocationCreateFlagBits>’
      719 |       return Flags<BitType>( m_mask ^ FlagTraits<BitType>::allFlags );
          |                                                            ^~~~~~~~
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::AllocatorCreateFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:169:44:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::AllocatorCreateFlagBits>’
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::DefragmentationFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:210:44:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::DefragmentationFlagBits>’
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::PoolCreateFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:251:39:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::PoolCreateFlagBits>’
    /usr/include/vulkan/vulkan.hpp: In instantiation of ‘constexpr vk::Flags<BitType> vk::Flags<BitType>::operator~() const [with BitType = vma::RecordFlagBits]’:
    /home/ashley/Programming/zombie-hunter/lib/vma/vk_mem_alloc.hpp:288:35:   required from here
    /usr/include/vulkan/vulkan.hpp:719:60: error: ‘allFlags’ is not a member of ‘vk::FlagTraits<vma::RecordFlagBits>’
    

    Hasn't been working for about a week or so

    opened by idliketobeatree 0
  • Compilation errors with apple clang

    Compilation errors with apple clang

    When trying to compile this with apple clang 11 I get compilation errors: explicit specialization of 'vk::FlagTraitsvma::AllocationCreateFlagBits' after instantiation explicit specialization of 'vk::FlagTraitsvma::AllocatorCreateFlagBits' after instantiation explicit specialization of 'vk::FlagTraitsvma::PoolCreateFlagBits' after instantiation explicit specialization of 'vk::FlagTraitsvma::RecordFlagBits' after instantiation

    It's fixed by moving the explicit specializations up to just below the enum definition of the FlagBits. Patched file attached.

    vk_mem_alloc.hpp.zip

    opened by pvlsrv 2
  • destroy function overloads.

    destroy function overloads.

    vulkan-hpp provides destroy function overloads. I'm not sure this makes the API better, but to be on par with the vulkan-hpp API I think they should be there.

    opened by gssgh 4
Owner
malte-v
malte-v
C++ (with python bindings) library for easily reading/writing/manipulating common animation particle formats such as PDB, BGEO, PTC. See the discussion group @ http://groups.google.com/group/partio-discuss

Partio - A library for particle IO and manipulation This is the initial source code release of partio a tool we used for particle reading/writing. It

Walt Disney Animation Studios 402 Jul 17, 2022
A tool for generating cross-language type declarations and interface bindings.

Djinni Djinni is a tool for generating cross-language type declarations and interface bindings. It's designed to connect C++ with either Java or Objec

Dropbox 2.8k Aug 1, 2022
C++11 API for creating Lua bindings

=head1 NAME luacxx - C++11 binding and modules for Lua =head1 SYNOPSIS // Create a new Lua environment to play with. auto env = lua::create

Aaron Faanes 148 Jun 18, 2022
🎮 C Bindings/Wrappers for Apple's METAL framework

Apple's Metal for C C Wrapper for Apple's METAL framework. This library is C bindings of Metal API (MetalGL). Since OpenGL is deprecated, this library

Recep Aslantas 107 Jul 31, 2022
🎮 C Bindings/Wrappers for Apple's METAL framework

Apple's Metal for C C Wrapper for Apple's METAL framework. This library is C bindings of Metal API (MetalGL). Since OpenGL is deprecated, this library

Recep Aslantas 107 Jul 31, 2022
RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library

Converting ascii text into (floating-point) numeric values is a very common problem. The fast_float header-only C++ library by Daniel Lemire does this very well, and very fast at up to or over to 1 gigabyte per second as described in more detail in a recent arXiv paper.

Dirk Eddelbuettel 18 May 2, 2022
ChakraCore bindings for aardio

ChakraCore-bindings-for-aardio ChakraCore is a Javascript engine with a C API you can use to add support for Javascript to any C or C compatible proje

null 9 Feb 18, 2022
HP-Socket bindings for aardio

HP-Socket-bindings-for-aardio HP-Socket is a high performance network framework. aardio is an extremely easy-to-use dynamic language, but it is also a

null 9 Jan 3, 2022
Godot bindings for the Rapier3D physics engine

Godot bindings for the Rapier3D physics library How to use There are two parts: A Godot module which must be compiled with the engine.

David Hoppenbrouwers 25 Jul 19, 2022
LLVM bindings for Node.js/JavaScript/TypeScript

llvm-bindings LLVM bindings for Node.js/JavaScript/TypeScript Supported OS macOS Ubuntu Windows Supported LLVM methods listed in the TypeScript defini

ApsarasX 240 Jul 30, 2022
RayLib extern bindings for Haxe

raylib-haxe Haxe bindings for RayLib usage haxelib git raylib-haxe https://github.com/haxeui/raylib-haxe package; import RayLib.*; import RayLib.Cam

HaxeUI 20 Jul 6, 2022
C# bindings for Sokol using Sokol's binding generator

C# bindings for Sokol using Sokol's binding generator

Michal Strehovský 25 Mar 22, 2022
Haxe bindings for raylib, a simple and easy-to-use library to learn videogame programming

Haxe bindings for raylib, a simple and easy-to-use library to learn videogame programming, Currently works only for windows but feel free the expand t

FSasquatch 27 Jul 8, 2022
Android Bindings for QuickJS, A fine little javascript engine.

quickjs-android quickjs-android 是 QuickJS JavaScript 引擎的 Android 接口框架,整体基于面向对象设计,提供了自动GC功能,使用简单。armeabi-v7a 的大小仅 350KB,是 Google V8 不错的替代品,启动速度比 V8 快,内

Wiki 95 Jul 28, 2022
Python bindings for Wasm3, the fastest WebAssembly interpreter

pywasm3 Python bindings for Wasm3, the fastest WebAssembly interpreter Main repository: Wasm3 project Install # Latest release: pip3 install pywasm3

Wasm3 Labs 46 Jun 17, 2022
Zig bindings for the excellent CRoaring library

Zig-Roaring This library implements Zig bindings for the CRoaring library. Naming Any C function that begins with roaring_bitmap_ is a method of the B

Justin Whear 4 Feb 23, 2022
LibreTranslate C++ bindings

LibreTranslate-cpp LibreTranslate C++17 bindings. Example usage #include <iostream> #include "LibreTranslate.h" int main(){ LibreTranslateAPI libr

Argos Open Tech 6 Jul 8, 2022
lua-nuspell is a set of Lua 5.x bindings for Nuspell spellchecking C++ library.

lua-nuspell lua-nuspell is a set of Lua 5.x bindings for Nuspell spellchecking C++ library. About Nuspell Nuspell is a fast and safe spelling checker

AF 7 Jul 3, 2022
Python bindings of silk codec.

Python silk module. --- pysilk --- APIs See test\test.py. import pysilk as m m.silkEncode(buf , 24000) m.silkDecode(buf , 24000) #the first param is b

DCZ_Yewen 15 Jul 2, 2022
PyCppAD — Python bindings for CppAD Automatic Differentiation library

PyCppAD is an open source framework which provides bindings for the CppAD Automatic Differentiation(CppAD) C++ library in Python. PyCppAD also includes support for the CppADCodeGen (CppADCodeGen), C++ library, which exploits CppAD functionality to perform code generation.

SimpleRobotics 12 Jun 15, 2022
SWIG bindings for raylib (to Lua, and hopefully other languages)

swigraylib SWIG binding for raylib This repo generates raylib bindings to other languages (eg. Lua), by providing a raylib.i SWIG interface file. SWIG

null 6 Oct 28, 2021
rlua -- High level bindings between Rust and Lua

rlua -- High level bindings between Rust and Lua

Amethyst Foundation 1.3k Aug 3, 2022
A next generation media player, with vim-like bindings

MusicKid A next generation media player, with vim-like bindings Installation Clone the repo git clone <git-url> cd MusicKid/Final Install dependencies

null 4 Jan 10, 2022
Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more.

mach/glfw - Ziggified GLFW bindings Ziggified GLFW bindings that Mach engine uses, with 100% API coverage, zero-fuss installation, cross compilation,

Hexops 171 Aug 8, 2022
Bindings, from the comfort and speed of C++ and without Qt.

KDBindings Bindings, from the comfort and speed of C++ and without Qt. From plain C++ you get: Signals + Slots. Properties templated on the contained

KDAB 180 Jul 4, 2022
hb-xlib bindings for Harbour language.

hb-xlib hb-xlib is a Harbour module providing bindings for the Xlib graphics library. This project is intended for people who want to start to program

Rafał Jopek 1 Feb 6, 2022
Capstone disassembly/disassembler framework: Core + bindings.

Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings.

Capstone Engine 5.8k Aug 5, 2022
autogen bindings to Raylib 4.0 and convenience wrappers on top. Requires use of `unsafe`

Raylib-CsLo Raylib-CsLo LowLevel autogen bindings to Raylib 4.0 and convenience wrappers on top. Requires use of unsafe A focus on performance. No run

NotNot 51 Jul 25, 2022