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

#1012 in Graphics APIs

Download history 3215/week @ 2023-12-16 2126/week @ 2023-12-23 1385/week @ 2023-12-30 2402/week @ 2024-01-06 2975/week @ 2024-01-13 2275/week @ 2024-01-20 1941/week @ 2024-01-27 1505/week @ 2024-02-03 2734/week @ 2024-02-10 3480/week @ 2024-02-17 2152/week @ 2024-02-24 3153/week @ 2024-03-02 2940/week @ 2024-03-09 2940/week @ 2024-03-16 3429/week @ 2024-03-23 3591/week @ 2024-03-30

13,419 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

~4.5MB
~98K SLoC