1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

wgpu backend: Enable WebGL fallback (#8038)

* Fix for https://github.com/emilk/eframe_template/issues/223
* Related: https://github.com/gfx-rs/wgpu/pull/9319

By default, we would only turn on the WebGPU backend on web, which means
browsers without WebGPU support would just crash.

You can still opt-out of all the default `wgpu` features by enabling
`eframe/wgpu_no_default_features` instead of `eframe/wgpu`
This commit is contained in:
Emil Ernerfeldt
2026-03-27 11:12:46 +01:00
committed by GitHub
parent 82a578e58c
commit 3cf3141e8f
6 changed files with 10 additions and 10 deletions

View File

@@ -89,7 +89,7 @@ web_screen_reader = ["web-sys/SpeechSynthesis", "web-sys/SpeechSynthesisUtteranc
## See <https://github.com/emilk/egui/issues/5889> for more details.
##
## By default, eframe will prefer WebGPU over WebGL, but
## you can configure this at run-time with [`NativeOptions::wgpu_options`].
## you can configure this at run-time with `WebOptions::wgpu_options`.
wgpu = ["wgpu_no_default_features", "egui-wgpu/default"]
## This is exactly like the `wgpu` feature, but does NOT enable the default features of `wgpu` and `egui-wgpu`.
@@ -155,7 +155,6 @@ glutin-winit = { workspace = true, optional = true, default-features = false, fe
"wgl",
] }
home = { workspace = true, optional = true }
wgpu = { workspace = true, optional = true }
# mac:
[target.'cfg(any(target_os = "macos"))'.dependencies]

View File

@@ -159,7 +159,7 @@ pub use {egui, egui::emath, egui::epaint};
pub use {egui_glow, glow};
#[cfg(feature = "wgpu_no_default_features")]
pub use {egui_wgpu, wgpu};
pub use {egui_wgpu, egui_wgpu::wgpu};
mod epi;