Skip to content

Commit

Permalink
egui-wgpu: turn off the default features of wgpu (#3875)
Browse files Browse the repository at this point in the history
This makes all `wgpu` features opt-in for `egui-wgpu` users.

For `eframe`, I opted to enable some `wgpu` features so users can still
use `eframe` without having to also opt-in to extra ewgpu features
(eframe is batteries-included).
  • Loading branch information
emilk authored Jan 24, 2024
1 parent 4d1a736 commit 3a8e234
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
20 changes: 0 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ glow = "0.13"
puffin = "0.18"
raw-window-handle = "0.6.0"
thiserror = "1.0.37"
wgpu = { version = "0.19.1", features = [
wgpu = { version = "0.19.1", default-features = false, features = [
# Make the renderer `Sync` even on wasm32, because it makes the code simpler:
"fragile-send-sync-non-atomic-wasm",
] }
Expand Down
7 changes: 6 additions & 1 deletion crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ pollster = { version = "0.3", optional = true } # needed for wgpu
glutin = { version = "0.31", optional = true }
glutin-winit = { version = "0.4", optional = true }
puffin = { workspace = true, optional = true }
wgpu = { workspace = true, optional = true }
wgpu = { workspace = true, optional = true, features = [
# Let's enable some backends so that users can use `eframe` out-of-the-box
# without having to explicitly opt-in to backends
"metal",
"webgpu",
] }

# mac:
[target.'cfg(any(target_os = "macos"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bytemuck = "1.7"
log = { version = "0.4", features = ["std"] }
thiserror.workspace = true
type-map = "0.5.0"
wgpu.workspace = true
wgpu = { workspace = true, features = ["wgsl"] }

#! ### Optional dependencies
## Enable this when generating docs.
Expand Down

0 comments on commit 3a8e234

Please sign in to comment.