gfx-rs/wgpu
Dependencies
wgpu's dependency tree is large because it touches every modern graphics API and every shader language. The root Cargo.toml's [workspace.dependencies] table pins every external crate; per-crate Cargo.tomls opt into them via workspace = true.
This page is a tour of what's in the tree and why.
Internal workspace dependencies
| Crate | Version |
|---|---|
wgpu |
29.0.0 |
wgpu-core |
29.0.0 |
wgpu-hal |
29.0.0 |
wgpu-types |
29.0.0 |
wgpu-macros |
29.0.0 |
wgpu-naga-bridge |
29.0.0 |
naga |
29.0.0 |
deno_webgpu |
0.181.0 (vendored, separate version line) |
All workspace members track version = "29.0.0" via [workspace.package]. Patches in [patch.crates-io] force wgpu itself to come from the in-tree path so examples and downstream test crates always use the local code.
Graphics-API bindings
| Crate | Backend | Used in |
|---|---|---|
ash 0.38 |
Vulkan | wgpu-hal/src/vulkan/ |
objc2 0.6, objc2-foundation, objc2-metal, objc2-quartz-core, objc2-core-foundation |
Metal | wgpu-hal/src/metal/ |
block2 0.6 |
Metal | Apple block helpers |
windows 0.62, windows-core, windows-result |
DX12 (and surfaces) | wgpu-hal/src/dx12/ |
glow 0.17 |
GL/GLES/WebGL2 | wgpu-hal/src/gles/ |
khronos-egl 6 |
EGL | wgpu-hal/src/gles/egl.rs |
glutin_wgl_sys 0.6 |
WGL | wgpu-hal/src/gles/wgl.rs |
glutin 0.32, glutin-winit 0.5 |
Examples only | examples/features/src/framework.rs |
raw-window-metal 1.0 |
macOS surface integration | wgpu-hal/src/metal/surface.rs |
raw-window-handle 0.6.2 |
Cross-platform window handles | All surface code |
Memory and resource allocation
gpu-allocator0.28 — Vulkan + DX12 memory.range-alloc0.1 — DX12 descriptor heap suballocation.mach-dxcompiler-rs0.1.4 — static DXC linkage.
Shader translation (naga)
bit-set,bit-vec— bitset utilities for arena indices.hashbrown0.17,indexmap2 — hash containers.petgraph0.8 — call graph analysis.rustc-hash1.1 —FxHasher. The repo pins to1.x; v2 has different perf characteristics.pp-rs0.2.1 — GLSL preprocessor.rspirv0.13,spirv0.4 — SPIR-V parsing/emission.unicode-ident— WGSL identifier classification.codespan-reporting0.13 — diagnostic formatting.
WebAssembly / web
wasm-bindgen0.2.108wasm-bindgen-futures0.4.58wasm-bindgen-testweb-sys0.3.85js-sys0.3.85console_error_panic_hookconsole_logweb-time1.1
Deno (only for deno_webgpu and cts_runner)
deno_console0.214,deno_core0.355,deno_features0.11,deno_url0.214,deno_web0.245,deno_webidl0.214.deno_unsync0.4.4,deno_error0.7.tokio1.47,termcolor1.4.
These pulls are heavyweight, which is why cts_runner and deno_webgpu are excluded from default-members.
General-purpose
arrayvec0.7 — small inline arrays.bitflags2.9 — bitflag struct generation.bytemuck1.22 — POD casting.cfg_aliases0.2.1 — cfg helpers, used in build.rs.cfg-if1 — branching on cfg conditions.flume0.12 — channels.futures-lite2 — small futures utilities.half2.5 — f16 support.heck0.5 — string casing.image0.25 — for examples and image-diff helpers.itertools0.14.libc0.2.172.libloading0.8 — dynamic loading (DXC, MoltenVK, etc.).libm0.2.6 —no_stdmath.log0.4.29.nanoserde0.2 — small serde alternative for tools.nanorand0.8 — small RNG for tests/examples.num-traits0.2.16.nv-flip0.1 — image perceptual diff for tests.obj0.10 — Wavefront OBJ loading for examples.once_cell1.21.ordered-float>=3, <6.0— pinned wide because Firefox vendors3.4.0.parking_lot0.12.3 — locks.portable-atomic,portable-atomic-util— atomics on no-atomic targets.profiling1.0.1 — tracing/profiling integration.serde1.0.225,serde_json1.0.143 — optional.smallvec1.14.static_assertions1.1.strum0.28 — enum iteration.thiserror2.0.12.tempfile3.tracy-client0.18 — Tracy profiler integration.walkdir2.3,which8 — forxtask.xshell0.2.2 — shell helpers inxtask.argh0.1.13 —naga-cliCLI parsing.pico-args0.5 —xtaskCLI parsing.
Dev/test-only
approx0.5 — float comparisons.arbitrary1.4.2 — fuzz tests.bincode2 — trace serialization.criterion(viabenches/) — benchmarking.ctor0.10 — test setup hooks.diff0.1 — snapshot diffs.env_logger0.11 (patched).exhaust0.2 — exhaustive iteration in tests.fern0.7 — alternate logger for some tests.glam0.32 — math for examples.libtest-mimic0.8 (patched).noise0.9 — examples.pollster0.4 — block-on for tests.regex-lite0.1.ron0.12 — older trace format.shell-words1.toml1.0.trybuild1 — compile-fail tests.
Patches
Two [patch.crates-io] overrides:
env_logger = { ..., git = "https://github.com/rust-cli/env_logger.git", rev = "d550741" }
libtest-mimic = { ..., git = "https://github.com/cwfitzgerald/libtest-mimic.git", rev = "9979b3c" }Both pull a hot-fix that hadn't shipped to crates.io.
wgpu itself is patched to its in-tree path:
wgpu = { path = "./wgpu" }So examples and integration tests always pick up local changes.
Dependency tracking
tests/tests/wgpu-dependency/— asserts the public dependency tree against a checked-in expected output viacargo tree. Catches accidental new dependencies.cargo-deny(.deny.toml) — license, advisory, banned, and duplicate checks.dependabotandrenovate[bot]— automated update PRs.
tests/tests/wgpu-dependency/ is what catches "I added a feature and now the public dependency tree changed shape on Linux but not on Windows" issues. It runs in CI on every PR.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.