Bindings for Vulkan Memory Allocator v3.2.0 in Odin Programming Language.
Copy the vma
folder to your project or shared
directory.
vma_vulkan_functions := vma.create_vulkan_functions()
allocator_create_info: vma.Allocator_Create_Info = {
flags = {.Buffer_Device_Address},
instance = instance,
vulkan_api_version = 1003000, // 1.3
physical_device = physical_device,
device = device,
vulkan_functions = &vma_vulkan_functions,
}
allocator: vma.Allocator = ---
if res := vma.create_allocator(allocator_create_info, &allocator); res != .SUCCESS {
log.errorf("Failed to Create Vulkan Memory Allocator: [%v]", res)
return
}
defer vma.destroy_allocator(allocator)
Precompiled binaries are not available, but you can easily compile the library using the provided scripts.
Requirements:
git
- Must be in the PATHVulkan SDK
- You can get from LunarXchange
Follow the steps below to build VMA:
Define the VMA_VULKAN_VERSION
option to specify the desired Vulkan version in the API format
(e.g., 1003000
for Vulkan 1.3).
Use the provided build scripts to compile the project.
Run build.bat
with the minor version as the first argument (e.g., build.bat 3
for Vulkan
1.3).
Make the script executable by running:
chmod +x build.sh
Run build.sh
with the minor version as the first argument (e.g., build.sh 3
for Vulkan
1.3).
Types and values follow the Odin Naming Convention. In general, Ada_Case
for types and
snake_case
for values
Case | |
---|---|
Import Name | snake_case (but prefer single word) |
Types | Ada_Case |
Enum Values | Ada_Case |
Procedures | snake_case |
Local Variables | snake_case |
Constant Variables | SCREAMING_SNAKE_CASE |
MIT License - See LICENSE file for details.