15 releases (8 breaking)

0.9.0 Jun 19, 2021
0.7.0 Jan 30, 2021
0.6.0 Aug 16, 2020
0.5.3 Jun 27, 2020
0.1.0 Dec 27, 2018

#1028 in Graphics APIs

Download history 2322/week @ 2024-03-13 3558/week @ 2024-03-20 3306/week @ 2024-03-27 3396/week @ 2024-04-03 3059/week @ 2024-04-10 3356/week @ 2024-04-17 3351/week @ 2024-04-24 2900/week @ 2024-05-01 2880/week @ 2024-05-08 2962/week @ 2024-05-15 3145/week @ 2024-05-22 3385/week @ 2024-05-29 2783/week @ 2024-06-05 2242/week @ 2024-06-12 2712/week @ 2024-06-19 2574/week @ 2024-06-26

10,808 downloads per month
Used in 180 crates (31 directly)

MIT/Apache

315KB
4.5K SLoC

Low-level graphics abstraction for Rust. Mostly operates on data, not types. Designed for use by libraries and higher-level abstractions only.

This crate provides a hardware abstraction layer for graphics adapters, for both compute and graphics operations. The API design is heavily inspired by the Vulkan API, and borrows some of the terminology.

Usage

Most of the functionality is implemented in separate crates, one for each backend. This crate only exposes a few generic traits and structures. You can import all the necessary traits through the [prelude][prelude] module.

The first step to using gfx-hal is to initialize one of the available [backends][Backend], by creating an [Instance][Instance]. Then proceed by enumerating the available graphics adapters and querying their available [features][Features] and queues.

You can use the open method on a PhysicalDevice to get a logical device handle, from which you can manage all the other device-specific resources.

Dependencies

~5MB
~103K SLoC