web: Detect and log whether WebAssembly extensions are actually used
This commit is contained in:
parent
44e59a0012
commit
db6731be2c
|
@ -427,7 +427,11 @@ export class RufflePlayer extends HTMLElement {
|
||||||
this,
|
this,
|
||||||
config
|
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.
|
// 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
|
// It may change by itself to "running" some milliseconds later. So we need to wait a little
|
||||||
|
|
|
@ -454,6 +454,15 @@ impl Ruffle {
|
||||||
})
|
})
|
||||||
.unwrap_or_default()
|
.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 {
|
impl Ruffle {
|
||||||
|
|
Loading…
Reference in New Issue