mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-08 16:30:41 +00:00
Merge pull request #5284 from vangel76/perf/web-wasm-simd128-2786
Fix #2786: the web build uses WebAssembly SIMD, so the canvas renders about 2.5x faster
This commit is contained in:
@@ -1,2 +1,9 @@
|
||||
[alias]
|
||||
xtask = "run --package xtask --"
|
||||
|
||||
# WebAssembly SIMD for the web build: without it vello_cpu's SIMD layer (fearless_simd) runs its
|
||||
# scalar fallback on wasm32 and the canvas renders about 2.4x slower (#2786). The web build then
|
||||
# needs Chrome/Edge 91+, Firefox 89+ or Safari 16.4+. A RUSTFLAGS environment variable replaces
|
||||
# these flags.
|
||||
[target.wasm32-unknown-unknown]
|
||||
rustflags = ["-C", "target-feature=+simd128"]
|
||||
|
||||
@@ -317,7 +317,7 @@ Installers and executables are code-signed.
|
||||
|
||||
| Build | File | Notes |
|
||||
|---|---|---|
|
||||
| Static site | `vectorcraft-web-<ver>.zip` | Runs in a modern browser; host it on any static server |
|
||||
| Static site | `vectorcraft-web-<ver>.zip` | Runs in a browser with WebAssembly SIMD (Chrome/Edge 91, Firefox 89, Safari 16.4 or newer), see `packaging/web/README.md`; host it on any static server |
|
||||
|
||||
## The Crafting Apps
|
||||
|
||||
|
||||
@@ -50,6 +50,23 @@ location /vectorcraft/ {
|
||||
|
||||
Local test: `python3 -m http.server 8765` inside the folder, then open http://localhost:8765/.
|
||||
|
||||
## Browser requirements
|
||||
|
||||
The wasm is built with WebAssembly SIMD (`-C target-feature=+simd128`, `.cargo/config.toml`,
|
||||
#2786), so it needs a browser that has it:
|
||||
|
||||
| Browser | First version |
|
||||
|---|---|
|
||||
| Chrome, Edge | 91 |
|
||||
| Firefox | 89 |
|
||||
| Safari (macOS and iOS/iPadOS) | 16.4 |
|
||||
|
||||
Source: caniuse `wasm-simd` and the WebAssembly feature table (webassembly.org/features). An older
|
||||
browser can't compile the module. There is no fallback build and no message: the page stays on
|
||||
"Loading VectorCraft..." and the console shows a WebAssembly compile error. The app also needs
|
||||
WebGPU or WebGL2 (see "Renderer selection" below). If you must serve older browsers, put a
|
||||
version check in front of the app on your own page.
|
||||
|
||||
## Fonts folder
|
||||
|
||||
Builds made with craft-fonts (`CRAFT_FONTS_DIR`, all releases) have a `fonts/` folder beside the
|
||||
|
||||
Reference in New Issue
Block a user