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.
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 [
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][Instance::enumerate_adapters] the available
[graphics adapters][adapter::Adapter] and querying their available
[features][Features] and [queues][queue::family::QueueFamily].
You can use the [
open][adapter::PhysicalDevice::open] method on a
PhysicalDevice][adapter::PhysicalDevice] to get a [logical device
handle][device::Device], from which you can manage all the other device-specific