From 71447b94fbdddc19495703d70037172fccd43048 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 16 Oct 2025 18:23:02 +0200 Subject: [PATCH] Examples: GLFW+WebGPU: default build to legacy for now. (#8381) --- examples/example_glfw_wgpu/Makefile.emscripten | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/example_glfw_wgpu/Makefile.emscripten b/examples/example_glfw_wgpu/Makefile.emscripten index 8ee398bc8..545a50578 100644 --- a/examples/example_glfw_wgpu/Makefile.emscripten +++ b/examples/example_glfw_wgpu/Makefile.emscripten @@ -34,9 +34,16 @@ EMS = # ("EMS" options gets added to both CPPFLAGS and LDFLAGS, whereas some options are for linker only) # Note: For glfw, we use emscripten-glfw port (contrib.glfw3) instead of (-s USE_GLFW=3) to get a better support for High DPI displays. EMS += -s DISABLE_EXCEPTION_CATCHING=1 --use-port=contrib.glfw3 -LDFLAGS += -s USE_WEBGPU=1 LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 +# (1) Using legacy WebGPU implementation (Emscripten < 4.0.10) +EMS += -DIMGUI_IMPL_WEBGPU_BACKEND_WGPU +LDFLAGS += -s USE_WEBGPU=1 + +# or (2) Using newer Dawn-based WebGPU port (Emscripten >= 4.0.10) (UNSUPPORTED YET) +#EMS += --use-port=emdawnwebgpu +#LDFLAGS += --use-port=emdawnwebgpu + # Build as single file (binary text encoded in .html file) #LDFLAGS += -sSINGLE_FILE