Expand description
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
-
counters
— Internally count resources and events for debugging purposes. If the counters feature is disabled, the counting infrastructure is removed from the build and the exposed counters always return 0. -
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. -
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. -
serde
— Enables serialization viaserde
on common wgpu types. -
trace
— Enable API tracing. -
observe_locks
— Enable lock order observation. -
replay
— Enable API replaying -
raw-window-handle
— Enable creating instances using raw-window-handle -
wgsl
— EnableShaderModuleSource::Wgsl
-
glsl
— EnableShaderModuleSource::Glsl
-
spirv
— EnableShaderModuleSource::SpirV
-
fragile-send-sync-non-atomic-wasm
— ImplementSend
andSync
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
andSync
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 themetal
backend. -
vulkan
— Enable thevulkan
backend. -
gles
— Enable theGLES
backend.This is used for all of GLES, OpenGL, and WebGL.
-
dx12
— Enable thedx12
backend.
Re-exports§
pub use naga;
Modules§
- conv 🔒
- Module for hashing utilities.
- Allocating resource ids, and tracking the resources they refer to.
- Lazy initialization of texture and buffer memory.
- lock 🔒Instrumented lock types.
- pool 🔒
- Presentation.
- snatch 🔒
- track 🔒Resource State and Lifetime Trackers
Macros§
- api_log 🔒