Skip to content

Commit

Permalink
deno_webgpu: Select wgpu backends based on target.
Browse files Browse the repository at this point in the history
This used to be managed by wgpu-core, but now must be handled by
wgpu-core's users - like this crate.
  • Loading branch information
jimblandy committed Dec 2, 2022
1 parent 6124f8e commit 089c536
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion deno_webgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,23 @@ description = "WebGPU implementation for Deno"
deno_core.workspace = true
serde = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["full"] }
wgpu-core = { workspace = true, features = ["trace", "replay", "serde", "strict_asserts", "wgsl"] }
wgpu-types = { workspace = true, features = ["trace", "replay", "serde"] }

[dependencies.wgpu-core]
workspace = true
features = ["trace", "replay", "serde", "strict_asserts", "wgsl", "gles"]

# We want the wgpu-core Metal backend on macOS and iOS.
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgpu-core]
workspace = true
features = ["metal"]

# We want the wgpu-core Direct3D backends on Windows.
[target.'cfg(windows)'.dependencies.wgpu-core]
workspace = true
features = ["dx11", "dx12"]

# We want the wgpu-core Vulkan backend on Unix (but not Emscripten) and Windows.
[target.'cfg(any(windows, all(unix, not(target_arch = "emscripten"))))'.dependencies.wgpu-core]
workspace = true
features = ["vulkan"]

0 comments on commit 089c536

Please sign in to comment.