A Vulkan binding generator for Zig that provides idiomatic Zig APIs, error integration, and automatic function loading.
vulkan-zig is a binding generator that creates Zig language bindings for the Vulkan graphics API from the official Vulkan XML registry. It transforms raw Vulkan C APIs into idiomatic Zig code, integrating Vulkan errors with Zig's error system, providing wrapper functions, and handling function pointer loading automatically. It solves the problem of manually maintaining low-level Vulkan bindings and ensures type safety and convenience for Zig developers.
Zig developers building Vulkan-based applications, such as game engines, graphics tools, or GPU-accelerated software, who need reliable and idiomatic access to the Vulkan API.
Developers choose vulkan-zig because it provides a more ergonomic and safer Vulkan programming experience in Zig compared to raw C bindings, with automatic error handling, slice support for buffers, and seamless build system integration, all while staying up-to-date with the latest Vulkan specifications.
Vulkan binding generator for Zig
Renames Vulkan functions and fields to follow Zig conventions, such as stripping vk prefixes and using snake_case for enums, as detailed in the 'Function & field renaming' section.
Maps Vulkan error codes to Zig error unions in wrapper functions, enabling compile-time error handling, exemplified by CreateInstanceError in the wrapper example.
Generates BaseDispatch, InstanceDispatch, and DeviceDispatch structures for type-safe dynamic loading of Vulkan function pointers, described in the 'Dispatch Tables' section.
Combines pointer and length parameters into slices in wrapper functions, simplifying buffer handling, as explained in the 'slices' subsection.
The README admits there is no functionality for selecting Vulkan feature levels or extensions during generation, leading to potential bloat or manual management.
vulkan-zig tracks Zig's master branch, which frequently breaks, requiring compatibility branches and lagging behind stable releases, as noted in the 'Zig versions' section.
Optional-ness of pointers in structs is not always correct per the registry, which can cause issues with non-compliant drivers, as mentioned in the 'Pointer types' section.
[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
Safe and rich Rust wrapper around the Vulkan API
The high-speed OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, WebGPU, and DirectX bindings library your mother warned you about.
Open-Source Vulkan C++ API
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.