KyleMayes / vulkanalia

Vulkan bindings for Rust.
Apache License 2.0
255 stars 30 forks source link
gamedev rust vulkan vulkan-bindings vulkan-tutorial

vulkanalia

Crate Documentation CI MSRV

Vulkan bindings for Rust.

Released under the Apache License 2.0.

Heavily inspired by the ash crate.

Vulkan Tutorial

For users new to Vulkan, there is a complete adaptation of https://vulkan-tutorial.com by Alexander Overvoorde to use Rust and vulkanalia instead of C++. The published version of this tutorial can be found here and the sources for the tutorial (including standalone working code examples for each chapter) are in this repository in the tutorial directory.

Overview

vulkanalia-sys consists of the Vulkan types and command signatures generated from the Vulkan API Registry. If you want to use the raw Vulkan API and are willing to handle function loading yourself you can use this crate.

vulkanalia offers a fairly thin wrapper around vulkanalia-sys that handles function loading for you and makes the Vulkan API somewhat less error prone and more idiomatic to use from Rust. For a detailed overview of how vulkanalia wraps the Vulkan API, see the API Concepts section of the Overview chapter of the Vulkan tutorial which can be found here.

But wait, there's more!

Cargo Features

The vulkanalia crate has the following notable non-default Cargo features:

By default, the vulkanalia-sys and vulkanalia crates depend on the Rust standard library. However, by disabling the default features for these crates, you can use either of these crates in a no_std environment. If you do this, the following features are of note:

Example

See the examples directory for an implementation of the classic triangle example using vulkanalia.