feat: use webgl backend when webgpu is not available

This commit is contained in:
2026-10-07 10:46:35 +02:00
parent 437a7249f4
commit 553a486d79
12 changed files with 1317 additions and 428 deletions
+3 -2
View File
@@ -1,14 +1,15 @@
#!/usr/bin/env bash
# Build the WebAssembly bundle into ./dist using wasm-bindgen.
# Serve it over HTTP (e.g. `python3 -m http.server -d dist 8080`) and open in a
# WebGPU-capable browser (recent Chrome/Edge, Firefox, or Safari 26+).
# WebGPU-capable browser (recent Chrome/Edge, Firefox, or Safari 26+); the
# `webgl` feature falls back to WebGL2 elsewhere (no Buddhabrot there).
set -euo pipefail
export PATH="$HOME/.cargo/bin:$PATH"
OUT="${1:-dist}"
echo "==> cargo build (wasm32, release)"
cargo build --release --target wasm32-unknown-unknown --features wasm
cargo build --release --target wasm32-unknown-unknown --features wasm,webgl
echo "==> wasm-bindgen -> $OUT"
mkdir -p "$OUT"