File tree Expand file tree Collapse file tree 6 files changed +7
-18
lines changed
Expand file tree Collapse file tree 6 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,11 @@ jobs:
8686 run : cargo build --verbose
8787
8888 - name : Build basisu vendor wasm
89- run : cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-Os -flto=full" --wasm-opt-flags="-Os"
90-
89+ run : cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-Os -msimd128 -flto=full -sEVAL_CTORS" --wasm-opt-flags="-Os --enable-simd --enable-bulk-memory-opt --enable-nontrapping-float-to-int"
9190 - name : Upload artifact
9291 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
9392 with :
9493 path : crates/basisu_sys/wasm/
9594
9695 - name : Build wasm
97- run : cargo build --target wasm32-unknown-unknown
96+ run : RUSTFLAGS="-Ctarget-feature=+simd128" cargo build --target wasm32-unknown-unknown
Original file line number Diff line number Diff line change 4949 targets : wasm32-unknown-unknown
5050
5151 - name : Build basisu vendor wasm
52- run : cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-sEVAL_CTORS -Os -flto=full" --wasm-opt-flags="-Os"
53-
52+ run : cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-Os -msimd128 -flto=full -sEVAL_CTORS" --wasm-opt-flags="-Os --enable-simd --enable-bulk-memory-opt --enable-nontrapping-float-to-int"
5453 - name : Upload artifact
5554 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5655 with :
Original file line number Diff line number Diff line change @@ -57,15 +57,14 @@ jobs:
5757 run : cargo binstall --force wasm-bindgen-cli
5858
5959 - name : Build basisu vendor wasm
60- run : cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-sEVAL_CTORS -Os -flto=full" --wasm-opt-flags="-Os"
61-
60+ run : cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-Os -msimd128 -flto=full -sEVAL_CTORS" --wasm-opt-flags="-Os --enable-simd --enable-bulk-memory-opt --enable-nontrapping-float-to-int"
6261 - name : Upload artifact
6362 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
6463 with :
6564 path : crates/basisu_sys/wasm/
6665
6766 - name : Build
68- run : cargo b -p test_scene --target wasm32-unknown-unknown --profile web_release
67+ run : RUSTFLAGS="-Ctarget-feature=+simd128" cargo b -p test_scene --target wasm32-unknown-unknown --profile web_release
6968
7069 - name : Wasm bindgen
7170 run : wasm-bindgen --out-name wasm_example --out-dir web/target/ --target web target/wasm32-unknown-unknown/web_release/test_scene.wasm
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ TLDR: Just build your bevy application to `wasm32-unknown-unknown` normally.
5959
6060The prebuilt wasm in ` crates/basisu_sys/wasm ` is automatically embedded in binary when building. It was prebuilt through CI with:
6161``` sh
62- cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags=" -sEVAL_CTORS -Os -flto=full" --wasm-opt-flags=" -Os"
62+ cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags=" -Os -msimd128 -flto=full -sEVAL_CTORS " --wasm-opt-flags=" -Os --enable-simd --enable-bulk-memory-opt --enable-nontrapping-float-to-int "
6363```
6464
6565## Bevy version compatibility
Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ fn compile_basisu_static() {
9898
9999fn gen_wasm_build_cmd ( ) {
100100 let wasm_args = [
101- "-msimd128" ,
102101 "-sSTRICT" ,
103102 "-sEXPORT_ES6" ,
104103 "-sINCOMING_MODULE_JS_API=wasmBinary" ,
Original file line number Diff line number Diff line change @@ -44,14 +44,7 @@ pub fn build_wasm_cmd() {
4444
4545 if let Some ( flags) = user_args. wasm_opt_flags {
4646 let mut wasm_opt_cmd = std:: process:: Command :: new ( "wasm-opt" ) ;
47- wasm_opt_cmd. args ( [
48- "--enable-simd" ,
49- "--enable-bulk-memory-opt" ,
50- "--enable-nontrapping-float-to-int" ,
51- "wasm/basisu_vendor.wasm" ,
52- "-o" ,
53- "wasm/basisu_vendor.wasm" ,
54- ] ) ;
47+ wasm_opt_cmd. args ( [ "wasm/basisu_vendor.wasm" , "-o" , "wasm/basisu_vendor.wasm" ] ) ;
5548
5649 wasm_opt_cmd. args ( flags. split ( " " ) . filter ( |s| !s. is_empty ( ) ) ) ;
5750
You can’t perform that action at this time.
0 commit comments