41 releases

0.19.3 Mar 1, 2024
0.19.1 Jan 22, 2024
0.18.1 Nov 26, 2023
0.17.0 Jul 21, 2023
0.0.1 Jul 15, 2021

#271 in Graphics APIs

Download history 32591/week @ 2023-12-05 35337/week @ 2023-12-12 34249/week @ 2023-12-19 32601/week @ 2023-12-26 38370/week @ 2024-01-02 41240/week @ 2024-01-09 49324/week @ 2024-01-16 46855/week @ 2024-01-23 47615/week @ 2024-01-30 54870/week @ 2024-02-06 57551/week @ 2024-02-13 56717/week @ 2024-02-20 59533/week @ 2024-02-27 56290/week @ 2024-03-05 51666/week @ 2024-03-12 49843/week @ 2024-03-19

225,965 downloads per month
Used in 1,186 crates (6 directly)

MIT/Apache

4.5MB
93K 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 accepts 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

~2–15MB
~179K SLoC