52 releases

new 0.19.4 Apr 18, 2024
0.19.3 Mar 1, 2024
0.19.2 Feb 29, 2024
0.18.1 Nov 15, 2023
0.5.6 Jul 9, 2020

#23 in #web-gpu

Download history 32730/week @ 2023-12-25 36370/week @ 2024-01-01 42495/week @ 2024-01-08 46758/week @ 2024-01-15 49448/week @ 2024-01-22 47106/week @ 2024-01-29 55826/week @ 2024-02-05 55699/week @ 2024-02-12 58317/week @ 2024-02-19 59237/week @ 2024-02-26 57098/week @ 2024-03-04 53932/week @ 2024-03-11 58406/week @ 2024-03-18 62558/week @ 2024-03-25 59330/week @ 2024-04-01 28546/week @ 2024-04-08

214,704 downloads per month
Used in 1,309 crates (12 directly)

MIT/Apache

5.5MB
118K SLoC

This library safely implements WebGPU on native platforms. It is designed for integration into browsers, as well as wrapping into other language-specific user-friendly libraries.

Feature flags

  • api_log_info --- Log all API entry points at info instead of trace level.

  • resource_log_info --- Log resource lifecycle management at info instead of trace level.

  • link (enabled by default) --- Use static linking for libraries. Disale to manually link. Enabled by default.

  • renderdoc --- Support the Renderdoc graphics debugger: https://renderdoc.org/

  • strict_asserts --- Apply run-time checks, even in release builds. These are in addition to the validation carried out at public APIs in all builds.

  • trace --- Enable API tracing.

  • replay --- Enable API replaying

  • serial-pass --- Enable serializable compute/render passes, and bundle encoders.

  • wgsl --- Enable ShaderModuleSource::Wgsl

  • fragile-send-sync-non-atomic-wasm --- Implement Send and Sync on Wasm, but only if atomics are not enabled.

    WebGL/WebGPU objects can not be shared between threads. However, it can be useful to artificially mark them as Send and Sync anyways to make it easier to write cross-platform code. This is technically very unsafe in a multithreaded environment, but on a wasm binary compiled without atomics we know we are definitely not in a multithreaded environment.

Backends, passed through to wgpu-hal

  • metal --- Enable the metal backend.

  • vulkan --- Enable the vulkan backend.

  • gles --- Enable the GLES backend.

    This is used for all of GLES, OpenGL, and WebGL.

  • dx12 --- Enable the dx12 backend.

Dependencies

~2–14MB
~148K SLoC