33 releases

0.9.1 Dec 23, 2021
0.9.0 Jun 20, 2021
0.8.5 Nov 13, 2020
0.8.2 Jun 15, 2020
0.2.2 Mar 25, 2019

#36 in Rendering

Download history 147/week @ 2021-09-27 88/week @ 2021-10-04 119/week @ 2021-10-11 156/week @ 2021-10-18 71/week @ 2021-10-25 156/week @ 2021-11-01 82/week @ 2021-11-08 47/week @ 2021-11-15 59/week @ 2021-11-22 118/week @ 2021-11-29 93/week @ 2021-12-06 84/week @ 2021-12-13 115/week @ 2021-12-20 107/week @ 2021-12-27 95/week @ 2022-01-03 24/week @ 2022-01-10

353 downloads per month
Used in openxr


20K SLoC

C++ 11K SLoC // 0.1% comments Rust 7.5K SLoC // 0.0% comments Python 1.5K SLoC // 0.3% comments C 218 SLoC // 0.2% comments AsciiDoc 96 SLoC // 0.0% comments Batch 80 SLoC PowerShell 69 SLoC // 0.2% comments


Documentation Crates.io License: MIT License: Apache 2.0

Rust bindings for the OpenXR virtual/augmented reality runtime API. Refer to the specification for detailed documentation on individual API calls.


The high-level bindings provide abstractions focusing on ergonomics and safety. Escape hatches to the raw API are exposed to support unforeseen requirements, and patterns that cannot be efficiently exposed in safe terms are preserved as unsafe.

The crate exposes a number of cargo features:

  • static builds in the Khronos OpenXR loader, which can then be accessed with Entry::linked(). This is the easiest way to get going, provided your environment has a working C++ compiler and CMake installation.
  • loaded allows access to a manually identified OpenXR implementation at run time. This allows for cases where a built-in Khronos loader, normally responsible for that task, cannot be used.
  • linked attempts to link to an OpenXR loader in the build environment. This is appropriate for target environments like desktop Linux which guarantee the presence of an OpenXR implementation or loader at a specific location, making a built-in loader redundant.
  • mint exposes From impls for converting to and from mint types where appropriate.

See openxr/examples/vulkan.rs for an example high-performance Vulkan rendering workflow.


The low-level bindings provide faithful unsafe access to the raw API, with ergonomics and type safety improved as much as feasible compared to a bindgen-style binding without reducing expressiveness. For example, symbols are named according to Rust conventions, enums and bitmasks are strongly typed, and many types have helpful Debug impls. This crate is almost entirely generated from the Khronos XML registry.