23 unstable releases (4 breaking)

Uses new Rust 2021

0.13.2 Jul 14, 2022
0.12.5 Apr 20, 2022
0.12.4 Jan 24, 2022
0.12.1 Dec 29, 2021
0.0.1 Jul 15, 2021

#154 in Graphics APIs

Download history 17639/week @ 2022-04-22 16672/week @ 2022-04-29 15800/week @ 2022-05-06 18141/week @ 2022-05-13 14806/week @ 2022-05-20 16420/week @ 2022-05-27 16221/week @ 2022-06-03 13190/week @ 2022-06-10 17796/week @ 2022-06-17 18706/week @ 2022-06-24 16669/week @ 2022-07-01 14037/week @ 2022-07-08 19824/week @ 2022-07-15 18667/week @ 2022-07-22 24998/week @ 2022-07-29 23353/week @ 2022-08-05

90,113 downloads per month
Used in 375 crates (3 directly)

MIT/Apache

1MB
25K 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

~6–15MB
~255K SLoC