Open-Source Wikis

/

wgpu

/

Reference

/

Dependencies

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-allocator 0.28 — Vulkan + DX12 memory.
  • range-alloc 0.1 — DX12 descriptor heap suballocation.
  • mach-dxcompiler-rs 0.1.4 — static DXC linkage.

Shader translation (naga)

  • bit-set, bit-vec — bitset utilities for arena indices.
  • hashbrown 0.17, indexmap 2 — hash containers.
  • petgraph 0.8 — call graph analysis.
  • rustc-hash 1.1 — FxHasher. The repo pins to 1.x; v2 has different perf characteristics.
  • pp-rs 0.2.1 — GLSL preprocessor.
  • rspirv 0.13, spirv 0.4 — SPIR-V parsing/emission.
  • unicode-ident — WGSL identifier classification.
  • codespan-reporting 0.13 — diagnostic formatting.

WebAssembly / web

  • wasm-bindgen 0.2.108
  • wasm-bindgen-futures 0.4.58
  • wasm-bindgen-test
  • web-sys 0.3.85
  • js-sys 0.3.85
  • console_error_panic_hook
  • console_log
  • web-time 1.1

Deno (only for deno_webgpu and cts_runner)

  • deno_console 0.214, deno_core 0.355, deno_features 0.11, deno_url 0.214, deno_web 0.245, deno_webidl 0.214.
  • deno_unsync 0.4.4, deno_error 0.7.
  • tokio 1.47, termcolor 1.4.

These pulls are heavyweight, which is why cts_runner and deno_webgpu are excluded from default-members.

General-purpose

  • arrayvec 0.7 — small inline arrays.
  • bitflags 2.9 — bitflag struct generation.
  • bytemuck 1.22 — POD casting.
  • cfg_aliases 0.2.1 — cfg helpers, used in build.rs.
  • cfg-if 1 — branching on cfg conditions.
  • flume 0.12 — channels.
  • futures-lite 2 — small futures utilities.
  • half 2.5 — f16 support.
  • heck 0.5 — string casing.
  • image 0.25 — for examples and image-diff helpers.
  • itertools 0.14.
  • libc 0.2.172.
  • libloading 0.8 — dynamic loading (DXC, MoltenVK, etc.).
  • libm 0.2.6 — no_std math.
  • log 0.4.29.
  • nanoserde 0.2 — small serde alternative for tools.
  • nanorand 0.8 — small RNG for tests/examples.
  • num-traits 0.2.16.
  • nv-flip 0.1 — image perceptual diff for tests.
  • obj 0.10 — Wavefront OBJ loading for examples.
  • once_cell 1.21.
  • ordered-float >=3, <6.0 — pinned wide because Firefox vendors 3.4.0.
  • parking_lot 0.12.3 — locks.
  • portable-atomic, portable-atomic-util — atomics on no-atomic targets.
  • profiling 1.0.1 — tracing/profiling integration.
  • serde 1.0.225, serde_json 1.0.143 — optional.
  • smallvec 1.14.
  • static_assertions 1.1.
  • strum 0.28 — enum iteration.
  • thiserror 2.0.12.
  • tempfile 3.
  • tracy-client 0.18 — Tracy profiler integration.
  • walkdir 2.3, which 8 — for xtask.
  • xshell 0.2.2 — shell helpers in xtask.
  • argh 0.1.13 — naga-cli CLI parsing.
  • pico-args 0.5 — xtask CLI parsing.

Dev/test-only

  • approx 0.5 — float comparisons.
  • arbitrary 1.4.2 — fuzz tests.
  • bincode 2 — trace serialization.
  • criterion (via benches/) — benchmarking.
  • ctor 0.10 — test setup hooks.
  • diff 0.1 — snapshot diffs.
  • env_logger 0.11 (patched).
  • exhaust 0.2 — exhaustive iteration in tests.
  • fern 0.7 — alternate logger for some tests.
  • glam 0.32 — math for examples.
  • libtest-mimic 0.8 (patched).
  • noise 0.9 — examples.
  • pollster 0.4 — block-on for tests.
  • regex-lite 0.1.
  • ron 0.12 — older trace format.
  • shell-words 1.
  • toml 1.0.
  • trybuild 1 — 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 via cargo tree. Catches accidental new dependencies.
  • cargo-deny (.deny.toml) — license, advisory, banned, and duplicate checks.
  • dependabot and renovate[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.

Dependencies – wgpu wiki | Factory