Skip to content

Conversation

@emilk
Copy link
Owner

@emilk emilk commented Oct 10, 2025

Unfortunately, just switching glow to wgpu causes build errors for web, and runtime errors on native.
Apparently we also need to turn on some wgpu features, but that… sucks. And it is not obvious from the eframe docs.
This needs fixing.

Native

> cargo run
thread 'main' panicked at /Users/emilk/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-27.0.1/src/api/instance.rs:65:13:
No wgpu backend feature that is implemented for the target platform was enabled. See `wgpu::Instance::enabled_backend_features()` for more information.

Web

error[E0433]: failed to resolve: could not find `web_sys` in `wgpu`
   --> /Users/emilk/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/egui-wgpu-0.33.0/src/setup.rs:58:31
    |
58  |                         wgpu::web_sys::window().is_some_and(|w| w.is_secure_context());
    |                               ^^^^^^^ could not find `web_sys` in `wgpu`
    |
note: found an item that was configured out
   --> /Users/emilk/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-27.0.1/src/lib.rs:143:9
    |
143 | pub use web_sys;
    |         ^^^^^^^
note: the item is gated here
   --> /Users/emilk/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-27.0.1/src/lib.rs:142:1
    |
142 | #[cfg(web)]
    | ^^^^^^^^^^^

@kasper64
Copy link

Maybe it's stupid question, but is there a workaround for this?
I looked for the possibility to enable feature of dependencies's dependences, but that doesn't seem possible.

@emilk emilk force-pushed the emilk/default-wgpu branch from 2f8cefc to ef74953 Compare November 11, 2025 17:05
@emilk
Copy link
Owner Author

emilk commented Nov 11, 2025

The work-around is as simple as adding an extra dependency on wgpu with default features enabled:

wgpu = { version = "27.0.1", default-features = true }

I'll see if we could/should do that in eframe already somehow to make this easier

@Resonanz
Copy link

Hey there @emilk , frame_template (with rust 1.88 and egui 0.33.0) with wgpu crashes on my M4 Mac (26.0.1). It has been doing this for a while. Glow works fine. Wgpu used to work.

Steps:

  1. Clone eframe_template
  2. Change feature "glow" to "wgpu"
  3. cargo run
  4. Crash.
thread 'main' panicked at /Users/me/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-27.0.1/src/api/instance.rs:65:13:
No wgpu backend feature that is implemented for the target platform was enabled. See `wgpu::Instance::enabled_backend_features()` for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants