lgpu is a small Vulkan 1.3 wrapper for Rust and C99. Patches that keep the dependency
set small, the build fast and the API explicit are the easiest to review.
lgpu/
├── crates/
│ ├── lgpu/ # high-level Rust API
│ ├── lgpu-hal/ # Vulkan 1.3 hardware abstraction layer
│ └── lgpu-c/ # C ABI bindings and lgpu.h
├── examples/ # examples, including c_example, cpp_example and zig_example
└── docs/ # architecture and safety notes
- Rust 1.80 or newer (stable).
- A Vulkan 1.3 driver with dynamic rendering (
VK_KHR_dynamic_rendering) and descriptor indexing. This covers current Mesa, AMD, Intel and NVIDIA drivers, plus MoltenVK on macOS. Without a device, the integration tests skip themselves.
Commands used in CI:
cargo check --workspace --all-targets
cargo test --workspace
cargo clippy --workspace --all-targets --all-features
cargo fmt --all -- --check
cargo run --release -p example-voxel-renderer- Code should build without warnings on stable Rust, including
cargo clippy. - Return
Result<T, Error>orResult<T, HalError>with a useful message instead of panicking. - Keep thread safety as documented:
Device,Queue,Buffer,TextureandSamplerareSend + Sync;CommandEncoderisSendbut notSync. Host mapped writes and image layout transitions must stay behind their mutexes. - When you add a function to
crates/lgpu-c/src/lib.rs, updatecrates/lgpu-c/include/lgpu.has well and use fixed width types for the ABI. - Add an integration test for any non-trivial fix or feature.
- Branch from
main. - Make sure the four commands above pass.
- Describe the change and, when it matters, the GPU and driver you tested on.
Pull requests and pushes to main run formatting, clippy with -D warnings, tests on
Linux, Windows and macOS, the C and C++ example builds, and the doc build. They never
publish crates or create releases.
Publishing is a separate workflow. It runs when a maintainer pushes a version tag such as
v0.1.5, or starts it manually with workflow_dispatch. A crates.io check skips versions
that are already published, so re-running the workflow is safe.