From accea1abdecbc1c038714f6d77b7fe0d3850309d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 7 Oct 2026 11:30:40 +0200 Subject: [PATCH] :zap: Enable wasm SIMD for Skia render-wasm builds (#12145) Link with -msimd128 and point SKIA_BINARIES_URL at the pdf+simd prebuilt archive. --- render-wasm/_build_env | 6 +++++- render-wasm/lint | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/render-wasm/_build_env b/render-wasm/_build_env index 2b653b185f..dc03bebd89 100644 --- a/render-wasm/_build_env +++ b/render-wasm/_build_env @@ -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 \ diff --git a/render-wasm/lint b/render-wasm/lint index 4ed7d6826d..0489e1040d 100755 --- a/render-wasm/lint +++ b/render-wasm/lint @@ -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"