17 unstable releases (3 breaking)

new 0.12.2 Jan 10, 2022
0.12.1 Dec 29, 2021
0.11.5 Dec 2, 2021
0.11.4 Oct 22, 2021
0.0.1 Jul 15, 2021

#35 in Hardware support

Download history 3392/week @ 2021-09-26 4920/week @ 2021-10-03 5120/week @ 2021-10-10 4761/week @ 2021-10-17 7022/week @ 2021-10-24 5627/week @ 2021-10-31 5675/week @ 2021-11-07 5702/week @ 2021-11-14 6470/week @ 2021-11-21 7734/week @ 2021-11-28 8447/week @ 2021-12-05 9978/week @ 2021-12-12 8094/week @ 2021-12-19 8758/week @ 2021-12-26 11768/week @ 2022-01-02 12103/week @ 2022-01-09

42,070 downloads per month
Used in 145 crates (2 directly)

MIT/Apache

1MB
23K SLoC

wgpu-hal is an explicit low-level GPU abstraction powering wgpu-core. It's a spiritual successor to gfx-hal, but with reduced scope, and oriented towards WebGPU implementation goals.

It has no overhead for validation or tracking, and the API translation overhead is kept to the bare minimum by the design of WebGPU. This API can be used for resource-demanding applications and engines.

Usage notes

All of the API is unsafe. Documenting the exact safety requirements for the state and function arguments is desired, but will likely be incomplete while the library is in early development.

The returned errors are only for cases that the user can't anticipate, such as running out-of-memory, or losing the device. For the counter-example, there is no error for mapping a buffer that's not mappable. As the buffer creator, the user should already know if they can map it.

The API accept iterators in order to avoid forcing the user to store data in particular containers. The implementation doesn't guarantee that any of the iterators are drained, unless stated otherwise by the function documentation. For this reason, we recommend that iterators don't do any mutating work.

Debugging

Most of the information in https://github.com/gfx-rs/wgpu/wiki/Debugging-wgpu-Applications still applies to this API, with an exception of API tracing/replay functionality, which is only available in wgpu-core.

Dependencies

~5.5–10MB
~175K SLoC