⚡ Enable wasm SIMD for Skia render-wasm builds (#12145)

Link with -msimd128 and point SKIA_BINARIES_URL at the pdf+simd prebuilt archive.
This commit is contained in:
Alejandro Alonso 2026-10-07 11:30:40 +02:00 committed by GitHub
parent 051f01d559
commit accea1abde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -20,7 +20,7 @@ fi
export BUILD_NAME="${BUILD_NAME:-render-wasm}"
export CARGO_BUILD_TARGET=${CARGO_BUILD_TARGET:-"wasm32-unknown-emscripten"};
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"target/$RENDER_TARGET"};
export SKIA_BINARIES_URL=${SKIA_BINARIES_URL:-"https://github.com/penpot/skia-binaries/releases/download/0.93.1/skia-binaries-319323662b1685a112f5-wasm32-unknown-emscripten-gl-svg-textlayout-binary-cache-webp.tar.gz"}
export SKIA_BINARIES_URL=${SKIA_BINARIES_URL:-"https://github.com/penpot/skia-binaries/releases/download/0.93.1/skia-binaries-319323662b1685a112f5-wasm32-unknown-emscripten-gl-svg-textlayout-binary-cache-webp-pdf-simd.tar.gz"}
# 256 MB of initial heap to perform less
# initial calls to memory grow.
@ -39,8 +39,12 @@ export EM_MEMORY_GROWTH_GEOMETRIC_STEP="0.8"
# Default: dlmalloc
export EM_MALLOC="dlmalloc"
# -msimd128: allow wasm SIMD in the linked module. Skia prebuilts must be
# built with the same flag (penpot/skia-binaries, WASM_SIMD=1) for Skia/skcms
# kernels to actually contain v128 ops; engines do not autovec scalar wasm.
export EMCC_CFLAGS="--no-entry \
--js-library src/js/wapi.js \
-msimd128 \
-sMALLOC=$EM_MALLOC \
-sINVOKE_RUN=0 \
-sALLOW_TABLE_GROWTH=0 \

View File

@ -11,7 +11,7 @@ fi
. ./_build_env frontend
export CARGO_BUILD_TARGET=${CARGO_BUILD_TARGET:-"wasm32-unknown-emscripten"};
export SKIA_BINARIES_URL=${SKIA_BINARIES_URL:-"https://github.com/penpot/skia-binaries/releases/download/0.93.1/skia-binaries-319323662b1685a112f5-wasm32-unknown-emscripten-gl-svg-textlayout-binary-cache-webp.tar.gz"}
export SKIA_BINARIES_URL=${SKIA_BINARIES_URL:-"https://github.com/penpot/skia-binaries/releases/download/0.93.1/skia-binaries-319323662b1685a112f5-wasm32-unknown-emscripten-gl-svg-textlayout-binary-cache-webp-pdf-simd.tar.gz"}
ALLOWED_RULES="-D static_mut_refs"