3 releases (breaking)
Uses new Rust 2024
| 0.3.0 | Apr 21, 2026 |
|---|---|
| 0.2.0 | Apr 17, 2026 |
| 0.1.0 | Apr 9, 2026 |
#2661 in Parser implementations
Used in vulkane
445KB
9K
SLoC
vulkan_gen
Vulkan XML specification parser and Rust binding generator. Used internally
by the vulkane crate, but reusable as a
standalone code generator.
vulkan_gen parses vk.xml
into typed Rust structures and emits a complete vulkan_bindings.rs file
with every type, constant, struct, enum, function pointer, and dispatch
table the spec defines. The parser uses roxmltree
DOM parsing to correctly handle nested elements like <member> and
<param> that contain mixed text and child element content.
For end users targeting Vulkan from Rust, install the
vulkane crate instead — it includes
vulkan_gen as a build dependency and exposes both the raw bindings and
a complete safe RAII wrapper for compute and graphics.
Standalone usage
If you want to generate your own bindings:
use vulkan_gen::generate_bindings;
let xml_path = std::path::Path::new("vk.xml");
let out_path = std::path::Path::new("vulkan_bindings.rs");
generate_bindings(xml_path, out_path)?;
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
Dependencies
~4–11MB
~231K SLoC