23 breaking releases

0.25.0 Aug 23, 2024
0.24.0 Jul 20, 2024
0.23.0 Mar 29, 2024
0.22.0 Sep 15, 2023
0.2.3 Nov 24, 2020

#69 in Graphics APIs

Download history 115/week @ 2024-08-24 156/week @ 2024-08-31 111/week @ 2024-09-07 141/week @ 2024-09-14 318/week @ 2024-09-21 255/week @ 2024-09-28 76/week @ 2024-10-05 65/week @ 2024-10-12 84/week @ 2024-10-19 81/week @ 2024-10-26 109/week @ 2024-11-02 39/week @ 2024-11-09 77/week @ 2024-11-16 120/week @ 2024-11-23 174/week @ 2024-11-30 294/week @ 2024-12-07

672 downloads per month
Used in 3 crates

Apache-2.0

6MB
154K SLoC

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.

Cargo Features

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

  • libloading (non-default) – enables integration with libloading (adds the LibloadingLoader struct which can be used to load the initial Vulkan commands from a Vulkan shared library)
  • window (non-default) – enables integration with raw-window-handle (adds the window module which can be used to create surfaces for windows from libraries that support raw-window-handle (e.g., winit)
  • provisional (non-default) – enables access to provisional Vulkan extensions (WARNING: these extensions are not guaranteed to be backwards compatible and are not intended to be used in production applications)

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:

  • no_std_error (non-default): enables implementations of the Error trait for various error types in vulkanalia and vulkanalia-sys when the default std feature is not enabled (the usage of the Error trait in core is not yet stable and requires the core-error feature to be enabled)

Example

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

Dependencies

~0–6.5MB
~12K SLoC