diff --git a/web/packages/core/src/ruffle-player.ts b/web/packages/core/src/ruffle-player.ts index 36c7be8c7..0189e8048 100644 --- a/web/packages/core/src/ruffle-player.ts +++ b/web/packages/core/src/ruffle-player.ts @@ -427,7 +427,11 @@ export class RufflePlayer extends HTMLElement { this, config ); - console.log("New Ruffle instance created."); + console.log( + "New Ruffle instance created (WebAssembly extensions: " + + (ruffleConstructor.is_wasm_simd_used() ? "ON" : "OFF") + + ")" + ); // In Firefox, AudioContext.state is always "suspended" when the object has just been created. // It may change by itself to "running" some milliseconds later. So we need to wait a little diff --git a/web/src/lib.rs b/web/src/lib.rs index ddd7fb26c..07447d1a8 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -454,6 +454,15 @@ impl Ruffle { }) .unwrap_or_default() } + + /// Returns whether the `simd128` target feature was enabled at build time. + /// This is intended to discriminate between the two WebAssembly module + /// versions, one of which uses WebAssembly extensions, and the other one + /// being "vanilla". `simd128` is used as proxy for most extensions, since + /// no other WebAssembly target feature is exposed to `cfg!`. + pub fn is_wasm_simd_used() -> bool { + cfg!(target_feature = "simd128") + } } impl Ruffle {