Tweaks to wasm nosimd loader
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
39e83285e2
commit
aca0e8d4db
3 changed files with 18 additions and 8 deletions
|
@ -128,6 +128,7 @@
|
|||
spinnerElement.style.display = 'none';
|
||||
} else {
|
||||
var canvasWrapper = document.getElementById('canvas_wrapper');
|
||||
var simdSupported = WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));
|
||||
|
||||
var Module = {
|
||||
preRun: [],
|
||||
|
@ -138,6 +139,9 @@
|
|||
canvasWrapper.style.display = 'block';
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
},
|
||||
locateFile: function(p,_) {
|
||||
return p.replace("CardinalMini"+".", simdSupported ? "CardinalMini." : "CardinalMini-nosimd.");
|
||||
},
|
||||
canvas: (function() {
|
||||
var canvas = document.getElementById('canvas');
|
||||
|
||||
|
@ -187,10 +191,10 @@
|
|||
};
|
||||
|
||||
var jsModuleName;
|
||||
if (!WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))) {
|
||||
jsModuleName = "CardinalMini-nosimd.js";
|
||||
} else {
|
||||
if (simdSupported) {
|
||||
jsModuleName = "CardinalMini.js";
|
||||
} else {
|
||||
jsModuleName = "CardinalMini-nosimd.js";
|
||||
}
|
||||
var jsModuleScript = document.createElement('script');
|
||||
jsModuleScript.setAttribute('async', true);
|
||||
|
|
|
@ -128,6 +128,7 @@
|
|||
spinnerElement.style.display = 'none';
|
||||
} else {
|
||||
var canvasWrapper = document.getElementById('canvas_wrapper');
|
||||
var simdSupported = WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));
|
||||
|
||||
var Module = {
|
||||
preRun: [],
|
||||
|
@ -138,6 +139,9 @@
|
|||
canvasWrapper.style.display = 'block';
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
},
|
||||
locateFile: function(p,_) {
|
||||
return p.replace("CardinalNative"+".", simdSupported ? "CardinalNative." : "CardinalNative-nosimd.");
|
||||
},
|
||||
canvas: (function() {
|
||||
var canvas = document.getElementById('canvas');
|
||||
|
||||
|
@ -187,10 +191,10 @@
|
|||
};
|
||||
|
||||
var jsModuleName;
|
||||
if (!WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))) {
|
||||
jsModuleName = "CardinalNative-nosimd.js";
|
||||
} else {
|
||||
if (simdSupported) {
|
||||
jsModuleName = "CardinalNative.js";
|
||||
} else {
|
||||
jsModuleName = "CardinalNative-nosimd.js";
|
||||
}
|
||||
var jsModuleScript = document.createElement('script');
|
||||
jsModuleScript.setAttribute('async', true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue