From 2c6611d0c6a862d996806722e72f56932f575dd8 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Tue, 5 Aug 2025 21:21:00 +0200 Subject: [PATCH] Enable wgpu default features in eframe / egui_wgpu default features (#7344) --- .github/workflows/rust.yml | 2 +- crates/eframe/Cargo.toml | 16 +++++----------- crates/egui-wgpu/Cargo.toml | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 493cc2fc..fece7f88 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -127,7 +127,7 @@ jobs: components: rust-src - name: Check wasm32+atomics eframe with wgpu - run: RUSTFLAGS='-C target-feature=+atomics' cargo +${{env.NIGHTLY_VERSION}} check -p eframe --lib --no-default-features --features wgpu --target wasm32-unknown-unknown -Z build-std=std,panic_abort + run: RUSTFLAGS='-C target-feature=+atomics' cargo +${{env.NIGHTLY_VERSION}} check -p eframe --lib --no-default-features --features wgpu,wgpu/webgpu --target wasm32-unknown-unknown -Z build-std=std,panic_abort # --------------------------------------------------------------------------- diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index 8f24bcd0..f1146058 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -40,6 +40,9 @@ default = [ "winit/default", "x11", "egui-wgpu?/fragile-send-sync-non-atomic-wasm", + # Let's enable some backends so that users can use `eframe` out-of-the-box + # without having to explicitly opt-in to backends + "egui-wgpu?/default" ] ## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/). @@ -167,12 +170,7 @@ glutin-winit = { workspace = true, optional = true, default-features = false, fe "wgl", ] } home = { 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", -] } +wgpu = { workspace = true, optional = true } # mac: [target.'cfg(any(target_os = "macos"))'.dependencies] @@ -268,11 +266,7 @@ web-sys = { workspace = true, features = [ # optional web: egui-wgpu = { workspace = true, optional = true } # if wgpu is used, use it without (!) winit -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 - "webgpu", -] } +wgpu = { workspace = true, optional = true } # Native dev dependencies for testing [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] diff --git a/crates/egui-wgpu/Cargo.toml b/crates/egui-wgpu/Cargo.toml index e637a878..94189f90 100644 --- a/crates/egui-wgpu/Cargo.toml +++ b/crates/egui-wgpu/Cargo.toml @@ -31,7 +31,7 @@ all-features = true rustdoc-args = ["--generate-link-to-definition"] [features] -default = ["fragile-send-sync-non-atomic-wasm"] +default = ["fragile-send-sync-non-atomic-wasm", "wgpu/default"] ## Enable [`winit`](https://docs.rs/winit) integration. On Linux, requires either `wayland` or `x11` winit = ["dep:winit", "winit/rwh_06"]