Files
craft-libs/crates/gpu-wgpu/Cargo.toml
T
dotCooCoo 2a5c894c73 craft-gpu-wgpu: depend on wgpu only where the code uses it
On native targets the crate uses wgpu only with `adapter-probe`, and on
wasm32 it does not use wgpu at all, so cargo reported the native wgpu
dependency, the noop dev-dependency and the wasm32 dependency as unused
(`cargo::unused_dependencies`). The native dependency is now optional and
`adapter-probe` turns it on; the `native-*` features set a wgpu backend
only when it is on. The wasm32 dependency is removed.
2026-11-20 19:54:27 -08:00

40 lines
1.4 KiB
TOML

[package]
name = "craft-gpu-wgpu"
description = "craft-gpu backend using wgpu (WebGPU on wasm32, native APIs on desktop)"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
[lints]
workspace = true
[dependencies]
craft-gpu = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Chooses and opens the device, and watches it for a loss (`adapter-probe`).
craft-gpu-device = { workspace = true, optional = true }
pollster = { workspace = true, optional = true }
# Native code uses wgpu only with `adapter-probe`.
wgpu = { workspace = true, optional = true }
[features]
default = []
adapter-probe = ["dep:pollster", "dep:craft-gpu-device", "dep:wgpu"]
native-vulkan = ["wgpu?/vulkan"]
native-dx12 = ["wgpu?/dx12"]
native-metal = ["wgpu?/metal"]
native-gles = ["wgpu?/gles"]
[dev-dependencies]
pollster = { workspace = true }
# Real-backend test (crates/gpu-wgpu/src/tests.rs): dispatches craft-gpu-providers' CPU-stand-in
# providers against a real WgpuContext, not just craft-gpu-null, per RFC-0022 acceptance
# requirement 2. Dev-only: no cycle (craft-gpu-providers never depends on craft-gpu-wgpu).
craft-gpu-providers = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
# The noop backend opens devices without a GPU in the tests.
wgpu = { workspace = true, features = ["noop"] }