This commit introduces the initial implementation for WebGPU on the
web via Emscripten. It enables the WebGPU backend in Filament when
compiling for WebAssembly, allowing both WebGL and WebGPU to be
shipped in the same filament.wasm binary.
Major changes:
- Build & CMake: Configured the WASM build to append the linker flag
`--use-port=emdawnwebgpu` and enable the WebGPU backend alongside WebGL.
- Platform Bridge: Added `WebGPUPlatformWasm`, connecting Filament's
WebGPU backend to the browser via `emscripten_webgpu_get_device()`.
- JS Bindings: Updated `utilities.js`, `extensions.js`, and `wasmloader.js`
to support asynchronous WebGPU adapter and device initialization
(`initWebGPU()`), skipping WebGL initialization when WEBGPU is selected.
- Workarounds: Integrated polyfills for Emscripten Dawn limitations,
including bypassing buggy pipeline layout bindings for `immediateSize`
and disabling unsupported WASM features like `TransientAttachments`.
- Remove conditional forgotten by #9897
Fixes cube_fl0 example
- Add byte array view methods that are no longer exported by
default in emscripten 5.0.4 (#9921)
Fixes redball tutorial
* Refactor web examples and tutorials
- Consolidate web/docs and web/samples into web/examples
- Remove literal programming blocks from Markdown tutorials
- Replace tutorial_template.html with a fully embedded template in serve.py
- Move serve.py to web/examples/serve.py and update dependency rules
- Update filament-js wrapper to expose _malloc, _free and set GEN_MIPMAPPABLE usage
- Update sample materials and WebGL asset generation within web/examples/CMakeLists.txt
- Add python venv instructions and usage details to web/README.md
- Remove obsolete examples, Pipfile, and demo templates
* Transfer web tutorials and samples to docs_src
- Introduce copy_web_docs.py api to deploy and rewrite web sample outputs into the docs output tree
- Hook copy_web_docs into docs_src/build/run.py natively
- Configure duplicates.json to map WebGL outputs to embedded .md docs
- Strip html skeleton out of examples in run.py so they map into markdown cleanly
- Update update-docs workflow to pre-build the WebGL target
- Remove obsolete remote docs path from src_raw
- Add explanatory comments to copy_web_docs.py and run.py
- Add index page with thumbnails for Web Tutorials and samples