Ergonomic, minimal Vulkan bindings for Rust, generated from vk.xml.
All commands are inherent methods on Entry, Instance, and Device, no trait imports needed.
Supports from_raw_parts for OpenXR and middleware interop, complete command loading for
every enabled extension, and 100% documentation coverage enforced in CI.
See the examples directory for progressively complex Vulkan programs, from minimal setup to textured rendering. Run them with cargo run --example hello_triangle_4.
If you're new to Vulkan, start with the Hello Triangle tutorial in the companion guide.
For a comprehensive project using vulkan-rust, check out Manifold.
| vulkan-rust | ash | vulkanalia | |
|---|---|---|---|
| Command style | Inherent methods | Trait-based | Trait-based |
from_raw_parts |
Yes, dedicated API | Yes | No |
| Documentation | 100% coverage, spec links, examples | Spec links only | Spec links + tutorial |
| Command loading | All enabled extensions | All enabled extensions | All enabled extensions |
no_std (sys crate) |
Yes | Yes | Yes |
Key differences from ash:
- No trait imports.
device.create_buffer(...)works directly, nouse DeviceV1_0. from_raw_partseverywhere. ConstructInstance/Devicefrom raw handles +vkGetInstanceProcAddr. Critical for OpenXR (XR_KHR_vulkan_enable2), middleware, and testing.- Full documentation coverage. Every public item documented with spec links, usage notes, and examples. A companion guide covers Vulkan concepts in depth.
vulkan-rust Ergonomic wrapper (Entry, Instance, Device)
vulkan-rust-sys Generated #[repr(C)] types from vk.xml (no_std)
vulkan-rust-codegen Code generator (not published)
Users depend on vulkan-rust and access raw types via vulkan_rust::vk::*.
| Platform | Library | Surface | CI Tested |
|---|---|---|---|
| Windows | vulkan-1.dll |
Win32 | Yes |
| Linux | libvulkan.so.1 |
X11, Wayland, XCB | Yes (+ lavapipe) |
| macOS | libvulkan.1.dylib |
Metal | Yes |
| Android | libvulkan.so |
Android | Build only |
| Flag | Default | Description |
|---|---|---|
surface |
Yes | Window surface creation via raw-window-handle. Disable with default-features = false for headless use. |
Progressive examples from minimal setup to textured rendering:
| Example | Lines | Concepts |
|---|---|---|
| hello_triangle_1 | 81 | Entry, Instance |
| hello_triangle_2 | 248 | Surface, Swapchain |
| hello_triangle_3 | 413 | Pipeline, Command buffers |
| hello_triangle_4 | 588 | Complete triangle |
| push_constants | 619 | Dynamic pipeline parameters |
| double_buffering | 620 | Triple-buffered rendering |
| resize | 702 | Window resize handling |
| textures | 930 | Image loading, sampling |
Run with cargo run --example hello_triangle_4.
The companion vulkan_rust Guide covers:
Getting Started - Installation | Hello Triangle 1-4
Concepts - Object Model | Memory | Synchronization | Render Passes | Pipelines | Descriptors | Command Buffers | pNext Chains | Validation
Architecture - Design Decisions | Error Handling
How-To - Migrate from ash | C-to-Rust Reference | Push Constants | Double Buffering | Resize | Textures
Information about testing, including where tests of various kinds live and how to run them.
The minimum supported Rust version is 1.85 (edition 2024).
MSRV bumps are treated as breaking changes and only happen in minor version increments (pre-1.0) or major version increments (post-1.0). Enforced in CI.
See CONTRIBUTING.md for documentation standards and the deprecation policy.
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc. This project is not affiliated with, endorsed by, or officially connected to Khronos in any way.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
