From 31000c3055bc5477e31b4bb130e956876c3352bc Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 7 Oct 2026 14:52:46 +0200 Subject: [PATCH] :zap: Enable rustc wasm SIMD for render-wasm builds (#12163) Set RUSTFLAGS target-feature=+simd128 on the emscripten target so our Rust code can autovec; Skia SIMD remains via the -simd prebuild and EMCC -msimd128. --- render-wasm/_build_env | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/render-wasm/_build_env b/render-wasm/_build_env index 2673c81ba4..0ed8f2bfe4 100644 --- a/render-wasm/_build_env +++ b/render-wasm/_build_env @@ -22,6 +22,13 @@ 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.153.3/skia-binaries-b7f043e0b1e2a850e702-wasm32-unknown-emscripten-gl-svg-textlayout-binary-cache-webp-pdf-simd.tar.gz"} +# Let rustc emit wasm SIMD for our Rust code (autovec / core::arch::wasm32). +# Skia SIMD still comes from the -simd prebuild + -msimd128 in EMCC_CFLAGS. +# Gate on the emscripten target so native `./test` is unaffected. +if [ "$CARGO_BUILD_TARGET" = "wasm32-unknown-emscripten" ]; then + export RUSTFLAGS="${RUSTFLAGS:-} -C target-feature=+simd128" +fi + # 256 MB of initial heap to perform less # initial calls to memory grow. export EM_INITIAL_HEAP=$((256 * 1024 * 1024))