1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

Make wgpu the default renderer for eframe and egui.rs (#7615)

* Closes https://github.com/emilk/egui/issues/5889

See the above issue for motivation.

To use glow instead, disable the default features of `eframe` and opt-in
to `glow`.

This also changes egui.rs to use wgpu, which means WebGPU when
available, and WebGL otherwise
This commit is contained in:
Emil Ernerfeldt
2025-11-13 11:16:23 +01:00
committed by GitHub
parent 51b0d0e4b9
commit 9ef610e16b
9 changed files with 90 additions and 43 deletions

View File

@@ -13,13 +13,13 @@ OPEN=false
OPTIMIZE=false
BUILD=debug
BUILD_FLAGS=""
WGPU=false
GLOW=false
WASM_OPT_FLAGS="-O2 --fast-math"
while test $# -gt 0; do
case "$1" in
-h|--help)
echo "build_demo_web.sh [--release] [--wgpu] [--open]"
echo "build_demo_web.sh [--release] [--glow] [--open]"
echo ""
echo " -g: Keep debug symbols even with --release."
echo " These are useful profiling and size trimming."
@@ -29,9 +29,7 @@ while test $# -gt 0; do
echo " --release: Build with --release, and then run wasm-opt."
echo " NOTE: --release also removes debug symbols, unless you also use -g."
echo ""
echo " --wgpu: Build a binary using wgpu instead of glow/webgl."
echo " The resulting binary will automatically use WebGPU if available and"
echo " fall back to a WebGL emulation layer otherwise."
echo " --glow: Build a binary using glow instead of wgpu."
exit 0
;;
@@ -52,9 +50,9 @@ while test $# -gt 0; do
BUILD_FLAGS="--release"
;;
--wgpu)
--glow)
shift
WGPU=true
GLOW=true
;;
*)
@@ -66,10 +64,10 @@ done
OUT_FILE_NAME="egui_demo_app"
if [[ "${WGPU}" == true ]]; then
FEATURES="${FEATURES},wgpu"
else
if [[ "${GLOW}" == true ]]; then
FEATURES="${FEATURES},glow"
else
FEATURES="${FEATURES},wgpu"
fi
FINAL_WASM_PATH=web_demo/${OUT_FILE_NAME}_bg.wasm