Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
dc6703c
feat: re-export vk types at crate root, removing submodule path requi…
Hiddentale Apr 3, 2026
758cc36
feat: codegen emits bool return type for VkBool32 output parameters
Hiddentale Apr 3, 2026
5de5c9b
fix: cmd_push_constants and other void-array commands now accept &[u8]
Hiddentale Apr 3, 2026
fca5640
fix: enumerate_device_extension_properties accepts Option<&CStr> inst…
Hiddentale Apr 3, 2026
665c3da
fix: cmd_bind_vertex_buffers p_offsets is now &[u64] instead of &u64
Hiddentale Apr 3, 2026
c190660
feat: bitmask types now have all() combining every defined flag
Hiddentale Apr 3, 2026
351142b
feat: generate Display/Error impls for enum types and builders for al…
Hiddentale Apr 3, 2026
1f93acd
feat: codegen emits typed PFN signatures and handles division-based a…
Hiddentale Apr 3, 2026
d16d7b4
feat: bitmask ordering support and DeviceSize/DeviceAddress aliases
Hiddentale Apr 3, 2026
fa5be90
fix: descriptor_count and similar count fields get setters when point…
Hiddentale Apr 3, 2026
25bb09a
refactor: strip p_ prefix from builder reference setters, matching sl…
Hiddentale Apr 3, 2026
dddfc7b
feat: typed ClearValue constructors and unreleased changelog
Hiddentale Apr 3, 2026
9520536
refactor: updated README
Hiddentale Apr 3, 2026
2d511fb
fix: add doc(inline) to re-exports so docs.rs renders type pages
Hiddentale Apr 3, 2026
9fe8034
refactor: fix: use absolute GitHub URLs in README for crates.io compa…
Hiddentale Apr 3, 2026
16a0208
feat: updated version to 0.10
Hiddentale Apr 3, 2026
334fca1
fix: regenerate vulkan-rust-sys
Hiddentale Apr 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ All notable changes to vulkan-rust will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.0] - 2026-04-03

### Added

- Builders for all plain (non-sType) structs, not just extensible ones (~200 new builders)
- `all()` method on bitmask types, combining every defined flag
- `Display` and `Error` impls on generated enum types (`vk::Result` now works with `?` and anyhow)
- `DeviceSize` and `DeviceAddress` type aliases
- `ClearValue::color_f32()`, `ClearValue::depth_stencil()`, and other typed constructors for union types
- `PartialOrd`/`Ord` derives on bitmask types

### Changed

- **Breaking:** All `vk::` submodules (`handles`, `structs`, `enums`, `bitmasks`, `constants`, `builders`) are now private with glob re-exports at the crate root. Use `vk::Buffer` instead of `vk::handles::Buffer`.
- **Breaking:** Builder setter methods for pointer fields drop the `p_` prefix (`p_vertex_input_state()` becomes `vertex_input_state()`, `p_application_info()` becomes `application_info()`)
- **Breaking:** `get_physical_device_surface_support_khr` returns `VkResult<bool>` instead of `VkResult<u32>`
- **Breaking:** `cmd_push_constants` and other void-array commands accept `&[u8]` instead of `&[c_void]`
- **Breaking:** Optional `const char*` params (e.g. `enumerate_device_extension_properties`) accept `Option<&CStr>` instead of `*const c_char`
- `ShaderModuleCreateInfo` builder has a single `.code(&[u32])` setter instead of separate `.code_size()` and `.p_code()`
- Multiple input arrays sharing a count param (e.g. `cmd_bind_vertex_buffers`) are all emitted as slices
- Count field setters are preserved when the paired pointer is optional (e.g. `descriptor_count` on `DescriptorSetLayoutBinding`)

### Fixed

- PFN callback types (`PFN_vkDebugUtilsMessengerCallbackEXT`, etc.) are now fully typed instead of type-erased `fn()`
- Parser prefers `altlen` over `len` from vk.xml, giving parseable C expressions instead of LaTeX
- `#[doc(inline)]` on all re-exports so docs.rs renders type pages under `vk::`
- README links use absolute GitHub URLs for crates.io compatibility
- Guide dependency version corrected from `"0.1"` to `"0.10"`

## [0.9.0] - 2026-04-03

Initial public release.
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ All new public items in `vulkan-rust` must follow this section order:
///
/// # Errors
///
/// - [`vk::enums::Result::ERROR_OUT_OF_HOST_MEMORY`], Host allocation failed.
/// - [`vk::Result::ERROR_OUT_OF_HOST_MEMORY`], Host allocation failed.
///
/// # Safety
///
Expand Down Expand Up @@ -128,7 +128,7 @@ Public API items must never be removed without a deprecation cycle:
1. **Deprecate** in a minor release using the built-in attribute:
```rust
#[deprecated(since = "0.3.0", note = "renamed to `create_instance_handle`")]
pub unsafe fn create_instance_raw(...) -> VkResult<vk::handles::Instance> {
pub unsafe fn create_instance_raw(...) -> VkResult<vk::Instance> {
self.create_instance_handle(...)
}
```
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[![CI](https://img.shields.io/github/actions/workflow/status/Hiddentale/vulkan_rust/ci.yml?branch=main&logo=github&label=CI)](https://github.com/Hiddentale/vulkan_rust/actions)
[![docs.rs](https://img.shields.io/docsrs/vulkan-rust?logo=docs.rs&label=docs.rs)](https://docs.rs/vulkan-rust)
[![crates.io](https://img.shields.io/crates/v/vulkan-rust?logo=rust)](https://crates.io/crates/vulkan-rust)
[![License](https://img.shields.io/crates/l/vulkan-rust)](LICENSE-MIT)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Hiddentale/vulkan_rust/blob/main/LICENSE-MIT)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](https://github.com/Hiddentale/vulkan_rust/blob/main/LICENSE-APACHE)

Ergonomic, minimal Vulkan bindings for Rust, generated from `vk.xml`.

Expand All @@ -15,10 +16,12 @@ every enabled extension, and 100% documentation coverage enforced in CI.

## Getting Started

See the [examples](vulkan-rust/examples) directory for progressively complex Vulkan programs, from minimal setup to textured rendering. Run them with `cargo run --example hello_triangle_4`.
See the [examples](https://github.com/Hiddentale/vulkan_rust/tree/main/vulkan-rust/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](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the companion guide.

For a comprehensive project using vulkan-rust, check out [Manifold](https://github.com/Hiddentale/manifold).

## Why vulkan-rust?

| | vulkan-rust | ash | vulkanalia |
Expand Down Expand Up @@ -66,14 +69,14 @@ Progressive examples from minimal setup to textured rendering:

| Example | Lines | Concepts |
|---------|-------|----------|
| [hello_triangle_1](vulkan-rust/examples/hello_triangle_1.rs) | 81 | Entry, Instance |
| [hello_triangle_2](vulkan-rust/examples/hello_triangle_2.rs) | 248 | Surface, Swapchain |
| [hello_triangle_3](vulkan-rust/examples/hello_triangle_3.rs) | 413 | Pipeline, Command buffers |
| [hello_triangle_4](vulkan-rust/examples/hello_triangle_4.rs) | 588 | Complete triangle |
| [push_constants](vulkan-rust/examples/push_constants.rs) | 619 | Dynamic pipeline parameters |
| [double_buffering](vulkan-rust/examples/double_buffering.rs) | 620 | Triple-buffered rendering |
| [resize](vulkan-rust/examples/resize.rs) | 702 | Window resize handling |
| [textures](vulkan-rust/examples/textures.rs) | 930 | Image loading, sampling |
| [hello_triangle_1](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/hello_triangle_1.rs) | 81 | Entry, Instance |
| [hello_triangle_2](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/hello_triangle_2.rs) | 248 | Surface, Swapchain |
| [hello_triangle_3](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/hello_triangle_3.rs) | 413 | Pipeline, Command buffers |
| [hello_triangle_4](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/hello_triangle_4.rs) | 588 | Complete triangle |
| [push_constants](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/push_constants.rs) | 619 | Dynamic pipeline parameters |
| [double_buffering](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/double_buffering.rs) | 620 | Triple-buffered rendering |
| [resize](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/resize.rs) | 702 | Window resize handling |
| [textures](https://github.com/Hiddentale/vulkan_rust/blob/main/vulkan-rust/examples/textures.rs) | 930 | Image loading, sampling |

Run with `cargo run --example hello_triangle_4`.

Expand All @@ -91,7 +94,7 @@ The companion [vulkan_rust Guide](https://hiddentale.github.io/vulkan_rust/) cov

## Testing

[Information about testing](docs/testing.md), including where tests of various kinds live and how to run them.
[Information about testing](https://github.com/Hiddentale/vulkan_rust/blob/main/docs/testing.md), including where tests of various kinds live and how to run them.

## MSRV Policy

Expand All @@ -101,7 +104,7 @@ MSRV bumps are treated as breaking changes and only happen in minor version incr

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for documentation standards and the deprecation policy.
See [CONTRIBUTING.md](https://github.com/Hiddentale/vulkan_rust/blob/main/CONTRIBUTING.md) for documentation standards and the deprecation policy.

## Disclaimer

Expand All @@ -112,7 +115,7 @@ This project is not affiliated with, endorsed by, or officially connected to Khr

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/Hiddentale/vulkan_rust/blob/main/LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](https://github.com/Hiddentale/vulkan_rust/blob/main/LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.
5 changes: 2 additions & 3 deletions guide/src/architecture/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ Every builder dereferences to its inner `vk::*` struct:

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::bitmasks::*;
use vk::*;

let info = BufferCreateInfo::builder()
.size(1024)
Expand All @@ -136,7 +135,7 @@ newtype around `i32`:

```rust,ignore
use vulkan_rust::vk;
use vk::enums::*;
use vk::*;

#[repr(transparent)]
pub struct Format(i32);
Expand Down
8 changes: 4 additions & 4 deletions guide/src/architecture/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ return value after every call.
```rust,ignore
use vulkan_rust::vk;

pub type VkResult<T> = std::result::Result<T, vk::enums::Result>;
pub type VkResult<T> = std::result::Result<T, vk::Result>;
```

Here `vk::Result` is the `#[repr(transparent)]` i32 newtype from `vulkan-rust-sys`.
Expand All @@ -35,7 +35,7 @@ A helper function performs the conversion:
```rust,ignore
use vulkan_rust::vk;

pub(crate) fn check(result: vk::enums::Result) -> VkResult<()> {
pub(crate) fn check(result: vk::Result) -> VkResult<()> {
if result.as_raw() >= 0 {
Ok(())
} else {
Expand Down Expand Up @@ -100,7 +100,7 @@ pub enum SurfaceError {
/// raw-window-handle returned an error.
HandleError(raw_window_handle::HandleError),
/// Vulkan error from the surface creation call.
Vulkan(vk::enums::Result),
Vulkan(vk::Result),
}
```

Expand Down Expand Up @@ -132,7 +132,7 @@ errors with `?`, handle them at the boundary.
```rust,ignore
use vulkan_rust::vk;
use vulkan_rust::Device;
use vk::handles::*;
use vk::*;

unsafe fn create_pipeline(
device: &Device,
Expand Down
20 changes: 6 additions & 14 deletions guide/src/concepts/command-buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ records a simple buffer copy, and submits it.

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::bitmasks::*;
use vk::*;

// Create a pool for the graphics queue family.
// RESET_COMMAND_BUFFER lets us reset individual command buffers
Expand All @@ -123,9 +122,7 @@ let command_pool = unsafe {

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::handles::*;
use vk::*;

// Allocate one primary command buffer from the pool.
let alloc_info = CommandBufferAllocateInfo::builder()
Expand All @@ -143,8 +140,7 @@ let command_buffer = unsafe {

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::bitmasks::*;
use vk::*;

// Begin recording. ONE_TIME_SUBMIT tells the driver this buffer
// will be submitted once and then reset or freed, enabling
Expand Down Expand Up @@ -187,8 +183,7 @@ unsafe { device.end_command_buffer(command_buffer)? };

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::handles::*;
use vk::*;

// Build a submit info. This describes:
// - which command buffers to execute
Expand Down Expand Up @@ -219,7 +214,7 @@ unsafe { device.queue_wait_idle(graphics_queue)? };

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::*;

// Option A: Free the command buffer back to the pool.
unsafe {
Expand Down Expand Up @@ -277,10 +272,7 @@ a command buffer just once. The pattern:

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::bitmasks::*;
use vk::handles::*;
use vk::*;

unsafe fn one_shot_submit(
device: &Device,
Expand Down
17 changes: 6 additions & 11 deletions guide/src/concepts/descriptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ The most common are `UNIFORM_BUFFER` and `COMBINED_IMAGE_SAMPLER`.

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::*;

// Describe the bindings: slot 0 is a uniform buffer visible to
// the vertex shader, slot 1 is a combined image sampler visible
Expand Down Expand Up @@ -107,8 +106,7 @@ let descriptor_layout = unsafe {

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::*;

// The pool must have enough room for the descriptor types we need.
// If we want 10 sets, each with 1 uniform buffer and 1 image sampler:
Expand Down Expand Up @@ -136,8 +134,7 @@ let descriptor_pool = unsafe {

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::handles::*;
use vk::*;

let alloc_info = DescriptorSetAllocateInfo::builder()
.descriptor_pool(descriptor_pool)
Expand All @@ -152,8 +149,7 @@ let descriptor_set = unsafe {

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::*;

// Point binding 0 to our uniform buffer.
let buffer_info = DescriptorBufferInfo {
Expand Down Expand Up @@ -190,7 +186,7 @@ unsafe { device.update_descriptor_sets(&writes, &[]) };

```rust,ignore
use vulkan_rust::vk;
use vk::enums::*;
use vk::*;

unsafe {
device.cmd_bind_descriptor_sets(
Expand Down Expand Up @@ -224,8 +220,7 @@ set 2 changes per object. You only rebind the sets that changed.

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::*;

// In pipeline layout creation:
let layouts = [per_frame_layout, per_material_layout, per_object_layout];
Expand Down
14 changes: 5 additions & 9 deletions guide/src/concepts/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ from the CPU into fast GPU memory. It uses the **staging buffer pattern**.

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::bitmasks::*;
use vk::*;

// The buffer that will hold the mesh on the GPU.
// TRANSFER_DST means "this buffer can receive data from a copy command."
Expand Down Expand Up @@ -159,7 +157,7 @@ let mem_requirements = unsafe {

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::*;

// Query what memory the hardware offers.
let mem_properties = unsafe {
Expand Down Expand Up @@ -192,7 +190,7 @@ let memory_type_index = (0..mem_properties.memory_type_count)

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::*;

let alloc_info = MemoryAllocateInfo::builder()
.allocation_size(mem_requirements.size)
Expand All @@ -213,9 +211,7 @@ in host-visible memory, write your data there, then copy to the GPU buffer.

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::enums::*;
use vk::bitmasks::*;
use vk::*;

// Create a temporary staging buffer in host-visible memory.
let staging_info = BufferCreateInfo::builder()
Expand Down Expand Up @@ -309,7 +305,7 @@ available on all hardware. The staging buffer pattern works everywhere.

```rust,ignore
use vulkan_rust::vk;
use vk::structs::*;
use vk::*;

fn find_memory_type(
mem_properties: &PhysicalDeviceMemoryProperties,
Expand Down
9 changes: 2 additions & 7 deletions guide/src/concepts/object-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ is labeled with its purpose.

```rust,ignore
use vulkan_rust::vk;
use vulkan_rust::vk::structs::*;
use vulkan_rust::vk::enums::*;
use vulkan_rust::vk::bitmasks::*;
use vulkan_rust::vk::handles::*;
use vulkan_rust::vk::*;
use vulkan_rust::vk::Handle;
use vulkan_rust::Device;

Expand Down Expand Up @@ -176,9 +173,7 @@ the entire pool is reset/destroyed at once):

```rust,ignore
use vulkan_rust::vk;
use vulkan_rust::vk::structs::*;
use vulkan_rust::vk::enums::*;
use vulkan_rust::vk::handles::*;
use vulkan_rust::vk::*;
use vulkan_rust::vk::Handle;

// Pool-based lifecycle (simplified)
Expand Down
Loading
Loading