vkgen

Generates Rust source code from vk.xml

Usage

$ vkgen <input file> <output file>

To use the generated file one has to add libloading to cargo.toml: [dependencies] libloading = "0.5.0" This is required to load vkGetInstanceProcAddr from a shared library. All other functions are loaded dynamically via vkGetInstanceProcAddr and vkGetDeviceProcAddr to avoid additional overhead.

Examples

This example demonstrates how to load libvulkan on linux and output the instance version (1.1.0), where vk.rs is a file containing the generated rust source code. ```rust mod vk;

fn main() { unsafe { vk::load("/usr/lib/x86_64-linux-gnu/libvulkan.so.1.1.92"); let mut v: u32 = 0; vk::vkEnumerateInstanceVersion(&mut i as *mut u32); println!("instance version is {}", v); } }

```

Known Issues