@sketch-hq/sketch-web-renderer 12.0.1 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/web-renderer/index.js +1 -1
- package/out/web-renderer/ts/utils/WasmModule.d.ts +1 -1
- package/out/web-renderer/wasm/Debug/web-renderer-debug.js +2885 -4128
- package/out/web-renderer/wasm/Debug/web-renderer-debug.mjs +2886 -4126
- package/out/web-renderer/wasm/Release/web-renderer-release.js +4068 -18
- package/out/web-renderer/wasm/Release/web-renderer-release.mjs +4068 -12
- package/out/web-renderer/{web-renderer-debug-bbc5d18c.js → web-renderer-debug-6a730e1e.js} +544 -825
- package/out/web-renderer/web-renderer-debug-ed8aaadf.js +1 -0
- package/out/web-renderer/web-renderer-release-ada2c2b2.js +1 -0
- package/out/web-renderer/{web-renderer-release-60255953.js → web-renderer-release-fd3e6306.js} +480 -787
- package/package.json +4 -3
- package/out/web-renderer/index-eb861739.js +0 -4742
- package/out/web-renderer/index-edb4bfa7.js +0 -1
- package/out/web-renderer/web-renderer-debug-35622728.js +0 -1
- package/out/web-renderer/web-renderer-release-dfe0d59b.js +0 -1
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import 'react';
|
|
3
|
-
|
|
4
|
-
var WebRendererWasmFactory = function () {
|
|
1
|
+
var WebRendererWasmFactory = (() => {
|
|
5
2
|
var _scriptName = import.meta.url;
|
|
6
3
|
return function () {
|
|
7
|
-
var _this = this;
|
|
8
4
|
var moduleArg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
5
|
var moduleRtn;
|
|
10
6
|
|
|
@@ -26,19 +22,15 @@ var WebRendererWasmFactory = function () {
|
|
|
26
22
|
|
|
27
23
|
// Set up the promise that indicates the Module is initialized
|
|
28
24
|
var readyPromiseResolve, readyPromiseReject;
|
|
29
|
-
var readyPromise = new Promise(
|
|
25
|
+
var readyPromise = new Promise((resolve, reject) => {
|
|
30
26
|
readyPromiseResolve = resolve;
|
|
31
27
|
readyPromiseReject = reject;
|
|
32
28
|
});
|
|
33
|
-
["_malloc", "_free", "_memory", "___indirect_function_table", "onRuntimeInitialized"].forEach(
|
|
29
|
+
["_malloc", "_free", "_memory", "___indirect_function_table", "onRuntimeInitialized"].forEach(prop => {
|
|
34
30
|
if (!Object.getOwnPropertyDescriptor(readyPromise, prop)) {
|
|
35
31
|
Object.defineProperty(readyPromise, prop, {
|
|
36
|
-
get:
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
set: function set() {
|
|
40
|
-
return abort('You are setting ' + prop + ' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js');
|
|
41
|
-
}
|
|
32
|
+
get: () => abort('You are getting ' + prop + ' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),
|
|
33
|
+
set: () => abort('You are setting ' + prop + ' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')
|
|
42
34
|
});
|
|
43
35
|
}
|
|
44
36
|
});
|
|
@@ -59,7 +51,7 @@ var WebRendererWasmFactory = function () {
|
|
|
59
51
|
// defensive during initialization.
|
|
60
52
|
var moduleOverrides = Object.assign({}, Module);
|
|
61
53
|
var thisProgram = './this.program';
|
|
62
|
-
var quit_ =
|
|
54
|
+
var quit_ = (status, toThrow) => {
|
|
63
55
|
throw toThrow;
|
|
64
56
|
};
|
|
65
57
|
|
|
@@ -92,7 +84,7 @@ var WebRendererWasmFactory = function () {
|
|
|
92
84
|
} else {
|
|
93
85
|
scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, '').lastIndexOf('/') + 1);
|
|
94
86
|
}
|
|
95
|
-
if (!(
|
|
87
|
+
if (!(typeof window == 'object' || typeof importScripts == 'function')) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
|
|
96
88
|
}
|
|
97
89
|
var out = Module['print'] || console.log.bind(console);
|
|
98
90
|
var err = Module['printErr'] || console.error.bind(console);
|
|
@@ -147,7 +139,7 @@ var WebRendererWasmFactory = function () {
|
|
|
147
139
|
|
|
148
140
|
var wasmBinary;
|
|
149
141
|
legacyModuleProp('wasmBinary', 'wasmBinary');
|
|
150
|
-
if (
|
|
142
|
+
if (typeof WebAssembly != 'object') {
|
|
151
143
|
err('no native wasm support detected');
|
|
152
144
|
}
|
|
153
145
|
|
|
@@ -219,7 +211,7 @@ var WebRendererWasmFactory = function () {
|
|
|
219
211
|
// include: runtime_stack_check.js
|
|
220
212
|
// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
|
|
221
213
|
function writeStackCookie() {
|
|
222
|
-
var max =
|
|
214
|
+
var max = _emscripten_stack_get_end();
|
|
223
215
|
assert((max & 3) == 0);
|
|
224
216
|
// If the stack ends at address zero we write our cookies 4 bytes into the
|
|
225
217
|
// stack. This prevents interference with SAFE_HEAP and ASAN which also
|
|
@@ -237,7 +229,7 @@ var WebRendererWasmFactory = function () {
|
|
|
237
229
|
}
|
|
238
230
|
function checkStackCookie() {
|
|
239
231
|
if (ABORT) return;
|
|
240
|
-
var max =
|
|
232
|
+
var max = _emscripten_stack_get_end();
|
|
241
233
|
// See writeStackCookie().
|
|
242
234
|
if (max == 0) {
|
|
243
235
|
max += 4;
|
|
@@ -317,7 +309,7 @@ var WebRendererWasmFactory = function () {
|
|
|
317
309
|
runDependencyTracking[id] = 1;
|
|
318
310
|
if (runDependencyWatcher === null && typeof setInterval != 'undefined') {
|
|
319
311
|
// Check for missing dependencies every few seconds
|
|
320
|
-
runDependencyWatcher = setInterval(
|
|
312
|
+
runDependencyWatcher = setInterval(() => {
|
|
321
313
|
if (ABORT) {
|
|
322
314
|
clearInterval(runDependencyWatcher);
|
|
323
315
|
runDependencyWatcher = null;
|
|
@@ -397,34 +389,34 @@ var WebRendererWasmFactory = function () {
|
|
|
397
389
|
// end include: memoryprofiler.js
|
|
398
390
|
// show errors on likely calls to FS when it was not included
|
|
399
391
|
var FS = {
|
|
400
|
-
error
|
|
392
|
+
error() {
|
|
401
393
|
abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM');
|
|
402
394
|
},
|
|
403
|
-
init
|
|
395
|
+
init() {
|
|
404
396
|
FS.error();
|
|
405
397
|
},
|
|
406
|
-
createDataFile
|
|
398
|
+
createDataFile() {
|
|
407
399
|
FS.error();
|
|
408
400
|
},
|
|
409
|
-
createPreloadedFile
|
|
401
|
+
createPreloadedFile() {
|
|
410
402
|
FS.error();
|
|
411
403
|
},
|
|
412
|
-
createLazyFile
|
|
404
|
+
createLazyFile() {
|
|
413
405
|
FS.error();
|
|
414
406
|
},
|
|
415
|
-
open
|
|
407
|
+
open() {
|
|
416
408
|
FS.error();
|
|
417
409
|
},
|
|
418
|
-
mkdev
|
|
410
|
+
mkdev() {
|
|
419
411
|
FS.error();
|
|
420
412
|
},
|
|
421
|
-
registerDevice
|
|
413
|
+
registerDevice() {
|
|
422
414
|
FS.error();
|
|
423
415
|
},
|
|
424
|
-
analyzePath
|
|
416
|
+
analyzePath() {
|
|
425
417
|
FS.error();
|
|
426
418
|
},
|
|
427
|
-
ErrnoError
|
|
419
|
+
ErrnoError() {
|
|
428
420
|
FS.error();
|
|
429
421
|
}
|
|
430
422
|
};
|
|
@@ -439,17 +431,13 @@ var WebRendererWasmFactory = function () {
|
|
|
439
431
|
* Indicates whether filename is a base64 data URI.
|
|
440
432
|
* @noinline
|
|
441
433
|
*/
|
|
442
|
-
var isDataURI =
|
|
443
|
-
return filename.startsWith(dataURIPrefix);
|
|
444
|
-
};
|
|
434
|
+
var isDataURI = filename => filename.startsWith(dataURIPrefix);
|
|
445
435
|
|
|
446
436
|
/**
|
|
447
437
|
* Indicates whether filename is delivered via file protocol (as opposed to http/https)
|
|
448
438
|
* @noinline
|
|
449
439
|
*/
|
|
450
|
-
var isFileURI =
|
|
451
|
-
return filename.startsWith('file://');
|
|
452
|
-
};
|
|
440
|
+
var isFileURI = filename => filename.startsWith('file://');
|
|
453
441
|
// end include: URIUtils.js
|
|
454
442
|
function createExportWrapper(name, nargs) {
|
|
455
443
|
return function () {
|
|
@@ -458,7 +446,7 @@ var WebRendererWasmFactory = function () {
|
|
|
458
446
|
assert(f, "exported native function `".concat(name, "` not found"));
|
|
459
447
|
// Only assert for too many arguments. Too few can be valid since the missing arguments will be zero filled.
|
|
460
448
|
assert(arguments.length <= nargs, "native function `".concat(name, "` called with ").concat(arguments.length, " args but expects ").concat(nargs));
|
|
461
|
-
return f
|
|
449
|
+
return f(...arguments);
|
|
462
450
|
};
|
|
463
451
|
}
|
|
464
452
|
|
|
@@ -492,26 +480,22 @@ var WebRendererWasmFactory = function () {
|
|
|
492
480
|
if (typeof fetch == 'function') {
|
|
493
481
|
return fetch(binaryFile, {
|
|
494
482
|
credentials: 'same-origin'
|
|
495
|
-
}).then(
|
|
483
|
+
}).then(response => {
|
|
496
484
|
if (!response['ok']) {
|
|
497
485
|
throw "failed to load wasm binary file at '".concat(binaryFile, "'");
|
|
498
486
|
}
|
|
499
487
|
return response['arrayBuffer']();
|
|
500
|
-
})
|
|
501
|
-
return getBinarySync(binaryFile);
|
|
502
|
-
});
|
|
488
|
+
}).catch(() => getBinarySync(binaryFile));
|
|
503
489
|
}
|
|
504
490
|
}
|
|
505
491
|
|
|
506
492
|
// Otherwise, getBinarySync should be able to get it synchronously
|
|
507
|
-
return Promise.resolve().then(
|
|
508
|
-
return getBinarySync(binaryFile);
|
|
509
|
-
});
|
|
493
|
+
return Promise.resolve().then(() => getBinarySync(binaryFile));
|
|
510
494
|
}
|
|
511
495
|
function instantiateArrayBuffer(binaryFile, imports, receiver) {
|
|
512
|
-
return getBinaryPromise(binaryFile).then(
|
|
496
|
+
return getBinaryPromise(binaryFile).then(binary => {
|
|
513
497
|
return WebAssembly.instantiate(binary, imports);
|
|
514
|
-
}).then(receiver,
|
|
498
|
+
}).then(receiver, reason => {
|
|
515
499
|
err("failed to asynchronously prepare wasm: ".concat(reason));
|
|
516
500
|
|
|
517
501
|
// Warn on some common problems.
|
|
@@ -525,7 +509,7 @@ var WebRendererWasmFactory = function () {
|
|
|
525
509
|
if (!binary && typeof WebAssembly.instantiateStreaming == 'function' && !isDataURI(binaryFile) && typeof fetch == 'function') {
|
|
526
510
|
return fetch(binaryFile, {
|
|
527
511
|
credentials: 'same-origin'
|
|
528
|
-
}).then(
|
|
512
|
+
}).then(response => {
|
|
529
513
|
// Suppress closure warning here since the upstream definition for
|
|
530
514
|
// instantiateStreaming only allows Promise<Repsponse> rather than
|
|
531
515
|
// an actual Response.
|
|
@@ -606,7 +590,7 @@ var WebRendererWasmFactory = function () {
|
|
|
606
590
|
if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary();
|
|
607
591
|
|
|
608
592
|
// If instantiation fails, reject the module ready promise.
|
|
609
|
-
instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult)
|
|
593
|
+
instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject);
|
|
610
594
|
return {}; // no exports yet; we'll fill them in later
|
|
611
595
|
}
|
|
612
596
|
|
|
@@ -616,7 +600,7 @@ var WebRendererWasmFactory = function () {
|
|
|
616
600
|
if (!Object.getOwnPropertyDescriptor(Module, prop)) {
|
|
617
601
|
Object.defineProperty(Module, prop, {
|
|
618
602
|
configurable: true,
|
|
619
|
-
get
|
|
603
|
+
get() {
|
|
620
604
|
var extra = incoming ? ' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' : '';
|
|
621
605
|
abort("`Module.".concat(prop, "` has been replaced by `").concat(newName, "`") + extra);
|
|
622
606
|
}
|
|
@@ -639,8 +623,8 @@ var WebRendererWasmFactory = function () {
|
|
|
639
623
|
if (typeof globalThis != 'undefined') {
|
|
640
624
|
Object.defineProperty(globalThis, sym, {
|
|
641
625
|
configurable: true,
|
|
642
|
-
get
|
|
643
|
-
|
|
626
|
+
get() {
|
|
627
|
+
warnOnce("`".concat(sym, "` is not longer defined by emscripten. ").concat(msg));
|
|
644
628
|
return undefined;
|
|
645
629
|
}
|
|
646
630
|
});
|
|
@@ -652,7 +636,7 @@ var WebRendererWasmFactory = function () {
|
|
|
652
636
|
if (typeof globalThis != 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) {
|
|
653
637
|
Object.defineProperty(globalThis, sym, {
|
|
654
638
|
configurable: true,
|
|
655
|
-
get
|
|
639
|
+
get() {
|
|
656
640
|
// Can't `abort()` here because it would break code that does runtime
|
|
657
641
|
// checks. e.g. `if (typeof SDL === 'undefined')`.
|
|
658
642
|
var msg = "`".concat(sym, "` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line");
|
|
@@ -667,7 +651,7 @@ var WebRendererWasmFactory = function () {
|
|
|
667
651
|
if (isExportedByForceFilesystem(sym)) {
|
|
668
652
|
msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
|
|
669
653
|
}
|
|
670
|
-
|
|
654
|
+
warnOnce(msg);
|
|
671
655
|
return undefined;
|
|
672
656
|
}
|
|
673
657
|
});
|
|
@@ -680,7 +664,7 @@ var WebRendererWasmFactory = function () {
|
|
|
680
664
|
if (!Object.getOwnPropertyDescriptor(Module, sym)) {
|
|
681
665
|
Object.defineProperty(Module, sym, {
|
|
682
666
|
configurable: true,
|
|
683
|
-
get
|
|
667
|
+
get() {
|
|
684
668
|
var msg = "'".concat(sym, "' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)");
|
|
685
669
|
if (isExportedByForceFilesystem(sym)) {
|
|
686
670
|
msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
|
|
@@ -700,29 +684,25 @@ var WebRendererWasmFactory = function () {
|
|
|
700
684
|
this.message = "Program terminated with exit(".concat(status, ")");
|
|
701
685
|
this.status = status;
|
|
702
686
|
}
|
|
703
|
-
var callRuntimeCallbacks =
|
|
687
|
+
var callRuntimeCallbacks = callbacks => {
|
|
704
688
|
while (callbacks.length > 0) {
|
|
705
689
|
// Pass the module as the first argument.
|
|
706
690
|
callbacks.shift()(Module);
|
|
707
691
|
}
|
|
708
692
|
};
|
|
709
693
|
var noExitRuntime = Module['noExitRuntime'] || true;
|
|
710
|
-
var ptrToString =
|
|
694
|
+
var ptrToString = ptr => {
|
|
711
695
|
assert(typeof ptr === 'number');
|
|
712
696
|
// With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
|
|
713
697
|
ptr >>>= 0;
|
|
714
698
|
return '0x' + ptr.toString(16).padStart(8, '0');
|
|
715
699
|
};
|
|
716
|
-
var stackRestore =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
var _warnOnce = function warnOnce(text) {
|
|
723
|
-
_warnOnce.shown || (_warnOnce.shown = {});
|
|
724
|
-
if (!_warnOnce.shown[text]) {
|
|
725
|
-
_warnOnce.shown[text] = 1;
|
|
700
|
+
var stackRestore = val => __emscripten_stack_restore(val);
|
|
701
|
+
var stackSave = () => _emscripten_stack_get_current();
|
|
702
|
+
var warnOnce = text => {
|
|
703
|
+
warnOnce.shown || (warnOnce.shown = {});
|
|
704
|
+
if (!warnOnce.shown[text]) {
|
|
705
|
+
warnOnce.shown[text] = 1;
|
|
726
706
|
err(text);
|
|
727
707
|
}
|
|
728
708
|
};
|
|
@@ -737,7 +717,7 @@ var WebRendererWasmFactory = function () {
|
|
|
737
717
|
* @param {number=} maxBytesToRead
|
|
738
718
|
* @return {string}
|
|
739
719
|
*/
|
|
740
|
-
var UTF8ArrayToString =
|
|
720
|
+
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
|
|
741
721
|
var endIdx = idx + maxBytesToRead;
|
|
742
722
|
var endPtr = idx;
|
|
743
723
|
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
|
@@ -771,7 +751,7 @@ var WebRendererWasmFactory = function () {
|
|
|
771
751
|
if ((u0 & 0xF0) == 0xE0) {
|
|
772
752
|
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
|
773
753
|
} else {
|
|
774
|
-
if ((u0 & 0xF8) != 0xF0)
|
|
754
|
+
if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte ' + ptrToString(u0) + ' encountered when deserializing a UTF-8 string in wasm memory to a JS string!');
|
|
775
755
|
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
|
|
776
756
|
}
|
|
777
757
|
if (u0 < 0x10000) {
|
|
@@ -799,18 +779,18 @@ var WebRendererWasmFactory = function () {
|
|
|
799
779
|
* JS JIT optimizations off, so it is worth to consider consistently using one
|
|
800
780
|
* @return {string}
|
|
801
781
|
*/
|
|
802
|
-
var UTF8ToString =
|
|
803
|
-
assert(typeof ptr == 'number', "UTF8ToString expects a number (got ".concat(
|
|
782
|
+
var UTF8ToString = (ptr, maxBytesToRead) => {
|
|
783
|
+
assert(typeof ptr == 'number', "UTF8ToString expects a number (got ".concat(typeof ptr, ")"));
|
|
804
784
|
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';
|
|
805
785
|
};
|
|
806
|
-
var ___assert_fail =
|
|
786
|
+
var ___assert_fail = (condition, filename, line, func) => {
|
|
807
787
|
abort("Assertion failed: ".concat(UTF8ToString(condition), ", at: ") + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
|
|
808
788
|
};
|
|
809
|
-
var __abort_js =
|
|
789
|
+
var __abort_js = () => {
|
|
810
790
|
abort('native code called abort()');
|
|
811
791
|
};
|
|
812
792
|
var structRegistrations = {};
|
|
813
|
-
var runDestructors =
|
|
793
|
+
var runDestructors = destructors => {
|
|
814
794
|
while (destructors.length) {
|
|
815
795
|
var ptr = destructors.pop();
|
|
816
796
|
var del = destructors.pop();
|
|
@@ -826,10 +806,10 @@ var WebRendererWasmFactory = function () {
|
|
|
826
806
|
var registeredTypes = {};
|
|
827
807
|
var typeDependencies = {};
|
|
828
808
|
var InternalError;
|
|
829
|
-
var throwInternalError =
|
|
809
|
+
var throwInternalError = message => {
|
|
830
810
|
throw new InternalError(message);
|
|
831
811
|
};
|
|
832
|
-
var whenDependentTypesAreResolved =
|
|
812
|
+
var whenDependentTypesAreResolved = (myTypes, dependentTypes, getTypeConverters) => {
|
|
833
813
|
myTypes.forEach(function (type) {
|
|
834
814
|
typeDependencies[type] = dependentTypes;
|
|
835
815
|
});
|
|
@@ -845,7 +825,7 @@ var WebRendererWasmFactory = function () {
|
|
|
845
825
|
var typeConverters = new Array(dependentTypes.length);
|
|
846
826
|
var unregisteredTypes = [];
|
|
847
827
|
var registered = 0;
|
|
848
|
-
dependentTypes.forEach(
|
|
828
|
+
dependentTypes.forEach((dt, i) => {
|
|
849
829
|
if (registeredTypes.hasOwnProperty(dt)) {
|
|
850
830
|
typeConverters[i] = registeredTypes[dt];
|
|
851
831
|
} else {
|
|
@@ -853,7 +833,7 @@ var WebRendererWasmFactory = function () {
|
|
|
853
833
|
if (!awaitingDependencies.hasOwnProperty(dt)) {
|
|
854
834
|
awaitingDependencies[dt] = [];
|
|
855
835
|
}
|
|
856
|
-
awaitingDependencies[dt].push(
|
|
836
|
+
awaitingDependencies[dt].push(() => {
|
|
857
837
|
typeConverters[i] = registeredTypes[dt];
|
|
858
838
|
++registered;
|
|
859
839
|
if (registered === unregisteredTypes.length) {
|
|
@@ -866,20 +846,16 @@ var WebRendererWasmFactory = function () {
|
|
|
866
846
|
onComplete(typeConverters);
|
|
867
847
|
}
|
|
868
848
|
};
|
|
869
|
-
var __embind_finalize_value_object =
|
|
849
|
+
var __embind_finalize_value_object = structType => {
|
|
870
850
|
var reg = structRegistrations[structType];
|
|
871
851
|
delete structRegistrations[structType];
|
|
872
852
|
var rawConstructor = reg.rawConstructor;
|
|
873
853
|
var rawDestructor = reg.rawDestructor;
|
|
874
854
|
var fieldRecords = reg.fields;
|
|
875
|
-
var fieldTypes = fieldRecords.map(
|
|
876
|
-
|
|
877
|
-
}).concat(fieldRecords.map(function (field) {
|
|
878
|
-
return field.setterArgumentType;
|
|
879
|
-
}));
|
|
880
|
-
whenDependentTypesAreResolved([structType], fieldTypes, function (fieldTypes) {
|
|
855
|
+
var fieldTypes = fieldRecords.map(field => field.getterReturnType).concat(fieldRecords.map(field => field.setterArgumentType));
|
|
856
|
+
whenDependentTypesAreResolved([structType], fieldTypes, fieldTypes => {
|
|
881
857
|
var fields = {};
|
|
882
|
-
fieldRecords.forEach(
|
|
858
|
+
fieldRecords.forEach((field, i) => {
|
|
883
859
|
var fieldName = field.fieldName;
|
|
884
860
|
var getterReturnType = fieldTypes[i];
|
|
885
861
|
var getter = field.getter;
|
|
@@ -888,10 +864,8 @@ var WebRendererWasmFactory = function () {
|
|
|
888
864
|
var setter = field.setter;
|
|
889
865
|
var setterContext = field.setterContext;
|
|
890
866
|
fields[fieldName] = {
|
|
891
|
-
read:
|
|
892
|
-
|
|
893
|
-
},
|
|
894
|
-
write: function write(ptr, o) {
|
|
867
|
+
read: ptr => getterReturnType['fromWireType'](getter(getterContext, ptr)),
|
|
868
|
+
write: (ptr, o) => {
|
|
895
869
|
var destructors = [];
|
|
896
870
|
setter(setterContext, ptr, setterArgumentType['toWireType'](destructors, o));
|
|
897
871
|
runDestructors(destructors);
|
|
@@ -900,7 +874,7 @@ var WebRendererWasmFactory = function () {
|
|
|
900
874
|
});
|
|
901
875
|
return [{
|
|
902
876
|
name: reg.name,
|
|
903
|
-
'fromWireType':
|
|
877
|
+
'fromWireType': ptr => {
|
|
904
878
|
var rv = {};
|
|
905
879
|
for (var i in fields) {
|
|
906
880
|
rv[i] = fields[i].read(ptr);
|
|
@@ -908,7 +882,7 @@ var WebRendererWasmFactory = function () {
|
|
|
908
882
|
rawDestructor(ptr);
|
|
909
883
|
return rv;
|
|
910
884
|
},
|
|
911
|
-
'toWireType':
|
|
885
|
+
'toWireType': (destructors, o) => {
|
|
912
886
|
// todo: Here we have an opportunity for -O3 level "unsafe" optimizations:
|
|
913
887
|
// assume all fields are present without checking.
|
|
914
888
|
for (var fieldName in fields) {
|
|
@@ -931,18 +905,18 @@ var WebRendererWasmFactory = function () {
|
|
|
931
905
|
}];
|
|
932
906
|
});
|
|
933
907
|
};
|
|
934
|
-
var embindRepr =
|
|
908
|
+
var embindRepr = v => {
|
|
935
909
|
if (v === null) {
|
|
936
910
|
return 'null';
|
|
937
911
|
}
|
|
938
|
-
var t =
|
|
912
|
+
var t = typeof v;
|
|
939
913
|
if (t === 'object' || t === 'array' || t === 'function') {
|
|
940
914
|
return v.toString();
|
|
941
915
|
} else {
|
|
942
916
|
return '' + v;
|
|
943
917
|
}
|
|
944
918
|
};
|
|
945
|
-
var embind_init_charCodes =
|
|
919
|
+
var embind_init_charCodes = () => {
|
|
946
920
|
var codes = new Array(256);
|
|
947
921
|
for (var i = 0; i < 256; ++i) {
|
|
948
922
|
codes[i] = String.fromCharCode(i);
|
|
@@ -950,7 +924,7 @@ var WebRendererWasmFactory = function () {
|
|
|
950
924
|
embind_charCodes = codes;
|
|
951
925
|
};
|
|
952
926
|
var embind_charCodes;
|
|
953
|
-
var readLatin1String =
|
|
927
|
+
var readLatin1String = ptr => {
|
|
954
928
|
var ret = "";
|
|
955
929
|
var c = ptr;
|
|
956
930
|
while (HEAPU8[c]) {
|
|
@@ -959,7 +933,7 @@ var WebRendererWasmFactory = function () {
|
|
|
959
933
|
return ret;
|
|
960
934
|
};
|
|
961
935
|
var BindingError;
|
|
962
|
-
var throwBindingError =
|
|
936
|
+
var throwBindingError = message => {
|
|
963
937
|
throw new BindingError(message);
|
|
964
938
|
};
|
|
965
939
|
|
|
@@ -982,9 +956,7 @@ var WebRendererWasmFactory = function () {
|
|
|
982
956
|
if (awaitingDependencies.hasOwnProperty(rawType)) {
|
|
983
957
|
var callbacks = awaitingDependencies[rawType];
|
|
984
958
|
delete awaitingDependencies[rawType];
|
|
985
|
-
callbacks.forEach(
|
|
986
|
-
return cb();
|
|
987
|
-
});
|
|
959
|
+
callbacks.forEach(cb => cb());
|
|
988
960
|
}
|
|
989
961
|
}
|
|
990
962
|
/** @param {Object=} options */
|
|
@@ -995,39 +967,23 @@ var WebRendererWasmFactory = function () {
|
|
|
995
967
|
}
|
|
996
968
|
return sharedRegisterType(rawType, registeredInstance, options);
|
|
997
969
|
}
|
|
998
|
-
var integerReadValueFromPointer =
|
|
970
|
+
var integerReadValueFromPointer = (name, width, signed) => {
|
|
999
971
|
// integers are quite common, so generate very specialized functions
|
|
1000
972
|
switch (width) {
|
|
1001
973
|
case 1:
|
|
1002
|
-
return signed ?
|
|
1003
|
-
return HEAP8[pointer];
|
|
1004
|
-
} : function (pointer) {
|
|
1005
|
-
return HEAPU8[pointer];
|
|
1006
|
-
};
|
|
974
|
+
return signed ? pointer => HEAP8[pointer] : pointer => HEAPU8[pointer];
|
|
1007
975
|
case 2:
|
|
1008
|
-
return signed ?
|
|
1009
|
-
return HEAP16[pointer >> 1];
|
|
1010
|
-
} : function (pointer) {
|
|
1011
|
-
return HEAPU16[pointer >> 1];
|
|
1012
|
-
};
|
|
976
|
+
return signed ? pointer => HEAP16[pointer >> 1] : pointer => HEAPU16[pointer >> 1];
|
|
1013
977
|
case 4:
|
|
1014
|
-
return signed ?
|
|
1015
|
-
return HEAP32[pointer >> 2];
|
|
1016
|
-
} : function (pointer) {
|
|
1017
|
-
return HEAPU32[pointer >> 2];
|
|
1018
|
-
};
|
|
978
|
+
return signed ? pointer => HEAP32[pointer >> 2] : pointer => HEAPU32[pointer >> 2];
|
|
1019
979
|
case 8:
|
|
1020
|
-
return signed ?
|
|
1021
|
-
return HEAP64[pointer >> 3];
|
|
1022
|
-
} : function (pointer) {
|
|
1023
|
-
return HEAPU64[pointer >> 3];
|
|
1024
|
-
};
|
|
980
|
+
return signed ? pointer => HEAP64[pointer >> 3] : pointer => HEAPU64[pointer >> 3];
|
|
1025
981
|
default:
|
|
1026
982
|
throw new TypeError("invalid integer width (".concat(width, "): ").concat(name));
|
|
1027
983
|
}
|
|
1028
984
|
};
|
|
1029
985
|
/** @suppress {globalThis} */
|
|
1030
|
-
var __embind_register_bigint =
|
|
986
|
+
var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => {
|
|
1031
987
|
name = readLatin1String(name);
|
|
1032
988
|
var isUnsignedType = name.indexOf('u') != -1;
|
|
1033
989
|
|
|
@@ -1036,10 +992,8 @@ var WebRendererWasmFactory = function () {
|
|
|
1036
992
|
maxRange = (1n << 64n) - 1n;
|
|
1037
993
|
}
|
|
1038
994
|
registerType(primitiveType, {
|
|
1039
|
-
name
|
|
1040
|
-
'fromWireType':
|
|
1041
|
-
return value;
|
|
1042
|
-
},
|
|
995
|
+
name,
|
|
996
|
+
'fromWireType': value => value,
|
|
1043
997
|
'toWireType': function toWireType(destructors, value) {
|
|
1044
998
|
if (typeof value != "bigint" && typeof value != "number") {
|
|
1045
999
|
throw new TypeError("Cannot convert \"".concat(embindRepr(value), "\" to ").concat(this.name));
|
|
@@ -1059,10 +1013,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1059
1013
|
};
|
|
1060
1014
|
var GenericWireTypeSize = 8;
|
|
1061
1015
|
/** @suppress {globalThis} */
|
|
1062
|
-
var __embind_register_bool =
|
|
1016
|
+
var __embind_register_bool = (rawType, name, trueValue, falseValue) => {
|
|
1063
1017
|
name = readLatin1String(name);
|
|
1064
1018
|
registerType(rawType, {
|
|
1065
|
-
name
|
|
1019
|
+
name,
|
|
1066
1020
|
'fromWireType': function fromWireType(wt) {
|
|
1067
1021
|
// ambiguous emscripten ABI: sometimes return values are
|
|
1068
1022
|
// true or false, and sometimes integers (0 or 1)
|
|
@@ -1078,7 +1032,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1078
1032
|
destructorFunction: null // This type does not need a destructor
|
|
1079
1033
|
});
|
|
1080
1034
|
};
|
|
1081
|
-
var shallowCopyInternalPointer =
|
|
1035
|
+
var shallowCopyInternalPointer = o => {
|
|
1082
1036
|
return {
|
|
1083
1037
|
count: o.count,
|
|
1084
1038
|
deleteScheduled: o.deleteScheduled,
|
|
@@ -1089,46 +1043,44 @@ var WebRendererWasmFactory = function () {
|
|
|
1089
1043
|
smartPtrType: o.smartPtrType
|
|
1090
1044
|
};
|
|
1091
1045
|
};
|
|
1092
|
-
var throwInstanceAlreadyDeleted =
|
|
1046
|
+
var throwInstanceAlreadyDeleted = obj => {
|
|
1093
1047
|
function getInstanceTypeName(handle) {
|
|
1094
1048
|
return handle.$$.ptrType.registeredClass.name;
|
|
1095
1049
|
}
|
|
1096
1050
|
throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');
|
|
1097
1051
|
};
|
|
1098
1052
|
var finalizationRegistry = false;
|
|
1099
|
-
var detachFinalizer =
|
|
1100
|
-
var runDestructor =
|
|
1053
|
+
var detachFinalizer = handle => {};
|
|
1054
|
+
var runDestructor = $$ => {
|
|
1101
1055
|
if ($$.smartPtr) {
|
|
1102
1056
|
$$.smartPtrType.rawDestructor($$.smartPtr);
|
|
1103
1057
|
} else {
|
|
1104
1058
|
$$.ptrType.registeredClass.rawDestructor($$.ptr);
|
|
1105
1059
|
}
|
|
1106
1060
|
};
|
|
1107
|
-
var releaseClassHandle =
|
|
1061
|
+
var releaseClassHandle = $$ => {
|
|
1108
1062
|
$$.count.value -= 1;
|
|
1109
1063
|
var toDelete = 0 === $$.count.value;
|
|
1110
1064
|
if (toDelete) {
|
|
1111
1065
|
runDestructor($$);
|
|
1112
1066
|
}
|
|
1113
1067
|
};
|
|
1114
|
-
var
|
|
1068
|
+
var downcastPointer = (ptr, ptrClass, desiredClass) => {
|
|
1115
1069
|
if (ptrClass === desiredClass) {
|
|
1116
1070
|
return ptr;
|
|
1117
1071
|
}
|
|
1118
1072
|
if (undefined === desiredClass.baseClass) {
|
|
1119
1073
|
return null; // no conversion
|
|
1120
1074
|
}
|
|
1121
|
-
var rv =
|
|
1075
|
+
var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass);
|
|
1122
1076
|
if (rv === null) {
|
|
1123
1077
|
return null;
|
|
1124
1078
|
}
|
|
1125
1079
|
return desiredClass.downcast(rv);
|
|
1126
1080
|
};
|
|
1127
1081
|
var registeredPointers = {};
|
|
1128
|
-
var getInheritedInstanceCount =
|
|
1129
|
-
|
|
1130
|
-
};
|
|
1131
|
-
var getLiveInheritedInstances = function getLiveInheritedInstances() {
|
|
1082
|
+
var getInheritedInstanceCount = () => Object.keys(registeredInstances).length;
|
|
1083
|
+
var getLiveInheritedInstances = () => {
|
|
1132
1084
|
var rv = [];
|
|
1133
1085
|
for (var k in registeredInstances) {
|
|
1134
1086
|
if (registeredInstances.hasOwnProperty(k)) {
|
|
@@ -1138,7 +1090,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1138
1090
|
return rv;
|
|
1139
1091
|
};
|
|
1140
1092
|
var deletionQueue = [];
|
|
1141
|
-
var flushPendingDeletes =
|
|
1093
|
+
var flushPendingDeletes = () => {
|
|
1142
1094
|
while (deletionQueue.length) {
|
|
1143
1095
|
var obj = deletionQueue.pop();
|
|
1144
1096
|
obj.$$.deleteScheduled = false;
|
|
@@ -1146,20 +1098,20 @@ var WebRendererWasmFactory = function () {
|
|
|
1146
1098
|
}
|
|
1147
1099
|
};
|
|
1148
1100
|
var delayFunction;
|
|
1149
|
-
var setDelayFunction =
|
|
1101
|
+
var setDelayFunction = fn => {
|
|
1150
1102
|
delayFunction = fn;
|
|
1151
1103
|
if (deletionQueue.length && delayFunction) {
|
|
1152
1104
|
delayFunction(flushPendingDeletes);
|
|
1153
1105
|
}
|
|
1154
1106
|
};
|
|
1155
|
-
var init_embind =
|
|
1107
|
+
var init_embind = () => {
|
|
1156
1108
|
Module['getInheritedInstanceCount'] = getInheritedInstanceCount;
|
|
1157
1109
|
Module['getLiveInheritedInstances'] = getLiveInheritedInstances;
|
|
1158
1110
|
Module['flushPendingDeletes'] = flushPendingDeletes;
|
|
1159
1111
|
Module['setDelayFunction'] = setDelayFunction;
|
|
1160
1112
|
};
|
|
1161
1113
|
var registeredInstances = {};
|
|
1162
|
-
var getBasestPointer =
|
|
1114
|
+
var getBasestPointer = (class_, ptr) => {
|
|
1163
1115
|
if (ptr === undefined) {
|
|
1164
1116
|
throwBindingError('ptr should not be undefined');
|
|
1165
1117
|
}
|
|
@@ -1169,11 +1121,11 @@ var WebRendererWasmFactory = function () {
|
|
|
1169
1121
|
}
|
|
1170
1122
|
return ptr;
|
|
1171
1123
|
};
|
|
1172
|
-
var getInheritedInstance =
|
|
1124
|
+
var getInheritedInstance = (class_, ptr) => {
|
|
1173
1125
|
ptr = getBasestPointer(class_, ptr);
|
|
1174
1126
|
return registeredInstances[ptr];
|
|
1175
1127
|
};
|
|
1176
|
-
var makeClassHandle =
|
|
1128
|
+
var makeClassHandle = (prototype, record) => {
|
|
1177
1129
|
if (!record.ptrType || !record.ptr) {
|
|
1178
1130
|
throwInternalError('makeClassHandle requires ptr and ptrType');
|
|
1179
1131
|
}
|
|
@@ -1185,7 +1137,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1185
1137
|
record.count = {
|
|
1186
1138
|
value: 1
|
|
1187
1139
|
};
|
|
1188
|
-
return
|
|
1140
|
+
return attachFinalizer(Object.create(prototype, {
|
|
1189
1141
|
$$: {
|
|
1190
1142
|
value: record,
|
|
1191
1143
|
writable: true
|
|
@@ -1228,7 +1180,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1228
1180
|
} else {
|
|
1229
1181
|
return makeClassHandle(this.registeredClass.instancePrototype, {
|
|
1230
1182
|
ptrType: this,
|
|
1231
|
-
ptr
|
|
1183
|
+
ptr
|
|
1232
1184
|
});
|
|
1233
1185
|
}
|
|
1234
1186
|
}
|
|
@@ -1243,7 +1195,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1243
1195
|
} else {
|
|
1244
1196
|
toType = registeredPointerRecord.pointerType;
|
|
1245
1197
|
}
|
|
1246
|
-
var dp =
|
|
1198
|
+
var dp = downcastPointer(rawPointer, this.registeredClass, toType.registeredClass);
|
|
1247
1199
|
if (dp === null) {
|
|
1248
1200
|
return makeDefaultHandle.call(this);
|
|
1249
1201
|
}
|
|
@@ -1261,22 +1213,20 @@ var WebRendererWasmFactory = function () {
|
|
|
1261
1213
|
});
|
|
1262
1214
|
}
|
|
1263
1215
|
}
|
|
1264
|
-
var
|
|
1216
|
+
var attachFinalizer = handle => {
|
|
1265
1217
|
if ('undefined' === typeof FinalizationRegistry) {
|
|
1266
|
-
|
|
1267
|
-
return handle;
|
|
1268
|
-
};
|
|
1218
|
+
attachFinalizer = handle => handle;
|
|
1269
1219
|
return handle;
|
|
1270
1220
|
}
|
|
1271
1221
|
// If the running environment has a FinalizationRegistry (see
|
|
1272
1222
|
// https://github.com/tc39/proposal-weakrefs), then attach finalizers
|
|
1273
1223
|
// for class handles. We check for the presence of FinalizationRegistry
|
|
1274
1224
|
// at run-time, not build-time.
|
|
1275
|
-
finalizationRegistry = new FinalizationRegistry(
|
|
1225
|
+
finalizationRegistry = new FinalizationRegistry(info => {
|
|
1276
1226
|
console.warn(info.leakWarning.stack.replace(/^Error: /, ''));
|
|
1277
1227
|
releaseClassHandle(info.$$);
|
|
1278
1228
|
});
|
|
1279
|
-
|
|
1229
|
+
attachFinalizer = handle => {
|
|
1280
1230
|
var $$ = handle.$$;
|
|
1281
1231
|
var hasSmartPtr = !!$$.smartPtr;
|
|
1282
1232
|
if (hasSmartPtr) {
|
|
@@ -1297,14 +1247,12 @@ var WebRendererWasmFactory = function () {
|
|
|
1297
1247
|
}
|
|
1298
1248
|
return handle;
|
|
1299
1249
|
};
|
|
1300
|
-
detachFinalizer =
|
|
1301
|
-
|
|
1302
|
-
};
|
|
1303
|
-
return _attachFinalizer(handle);
|
|
1250
|
+
detachFinalizer = handle => finalizationRegistry.unregister(handle);
|
|
1251
|
+
return attachFinalizer(handle);
|
|
1304
1252
|
};
|
|
1305
|
-
var init_ClassHandle =
|
|
1253
|
+
var init_ClassHandle = () => {
|
|
1306
1254
|
Object.assign(ClassHandle.prototype, {
|
|
1307
|
-
"isAliasOf"
|
|
1255
|
+
"isAliasOf"(other) {
|
|
1308
1256
|
if (!(this instanceof ClassHandle)) {
|
|
1309
1257
|
return false;
|
|
1310
1258
|
}
|
|
@@ -1326,7 +1274,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1326
1274
|
}
|
|
1327
1275
|
return leftClass === rightClass && left === right;
|
|
1328
1276
|
},
|
|
1329
|
-
"clone"
|
|
1277
|
+
"clone"() {
|
|
1330
1278
|
if (!this.$$.ptr) {
|
|
1331
1279
|
throwInstanceAlreadyDeleted(this);
|
|
1332
1280
|
}
|
|
@@ -1334,7 +1282,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1334
1282
|
this.$$.count.value += 1;
|
|
1335
1283
|
return this;
|
|
1336
1284
|
} else {
|
|
1337
|
-
var clone =
|
|
1285
|
+
var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), {
|
|
1338
1286
|
$$: {
|
|
1339
1287
|
value: shallowCopyInternalPointer(this.$$)
|
|
1340
1288
|
}
|
|
@@ -1344,7 +1292,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1344
1292
|
return clone;
|
|
1345
1293
|
}
|
|
1346
1294
|
},
|
|
1347
|
-
"delete"
|
|
1295
|
+
"delete"() {
|
|
1348
1296
|
if (!this.$$.ptr) {
|
|
1349
1297
|
throwInstanceAlreadyDeleted(this);
|
|
1350
1298
|
}
|
|
@@ -1358,10 +1306,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1358
1306
|
this.$$.ptr = undefined;
|
|
1359
1307
|
}
|
|
1360
1308
|
},
|
|
1361
|
-
"isDeleted"
|
|
1309
|
+
"isDeleted"() {
|
|
1362
1310
|
return !this.$$.ptr;
|
|
1363
1311
|
},
|
|
1364
|
-
"deleteLater"
|
|
1312
|
+
"deleteLater"() {
|
|
1365
1313
|
if (!this.$$.ptr) {
|
|
1366
1314
|
throwInstanceAlreadyDeleted(this);
|
|
1367
1315
|
}
|
|
@@ -1379,12 +1327,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1379
1327
|
};
|
|
1380
1328
|
/** @constructor */
|
|
1381
1329
|
function ClassHandle() {}
|
|
1382
|
-
var createNamedFunction =
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
};
|
|
1387
|
-
var ensureOverloadTable = function ensureOverloadTable(proto, methodName, humanName) {
|
|
1330
|
+
var createNamedFunction = (name, body) => Object.defineProperty(body, 'name', {
|
|
1331
|
+
value: name
|
|
1332
|
+
});
|
|
1333
|
+
var ensureOverloadTable = (proto, methodName, humanName) => {
|
|
1388
1334
|
if (undefined === proto[methodName].overloadTable) {
|
|
1389
1335
|
var prevFunc = proto[methodName];
|
|
1390
1336
|
// Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
|
|
@@ -1405,7 +1351,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1405
1351
|
};
|
|
1406
1352
|
|
|
1407
1353
|
/** @param {number=} numArguments */
|
|
1408
|
-
var exposePublicSymbol =
|
|
1354
|
+
var exposePublicSymbol = (name, value, numArguments) => {
|
|
1409
1355
|
if (Module.hasOwnProperty(name)) {
|
|
1410
1356
|
if (undefined === numArguments || undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments]) {
|
|
1411
1357
|
throwBindingError("Cannot register public name '".concat(name, "' twice"));
|
|
@@ -1428,7 +1374,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1428
1374
|
};
|
|
1429
1375
|
var char_0 = 48;
|
|
1430
1376
|
var char_9 = 57;
|
|
1431
|
-
var makeLegalFunctionName =
|
|
1377
|
+
var makeLegalFunctionName = name => {
|
|
1432
1378
|
if (undefined === name) {
|
|
1433
1379
|
return '_unknown';
|
|
1434
1380
|
}
|
|
@@ -1452,7 +1398,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1452
1398
|
this.downcast = downcast;
|
|
1453
1399
|
this.pureVirtualFunctions = [];
|
|
1454
1400
|
}
|
|
1455
|
-
var upcastPointer =
|
|
1401
|
+
var upcastPointer = (ptr, ptrClass, desiredClass) => {
|
|
1456
1402
|
while (ptrClass !== desiredClass) {
|
|
1457
1403
|
if (!ptrClass.upcast) {
|
|
1458
1404
|
throwBindingError("Expected null or instance of ".concat(desiredClass.name, ", got an instance of ").concat(ptrClass.name));
|
|
@@ -1536,9 +1482,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1536
1482
|
ptr = handle.$$.smartPtr;
|
|
1537
1483
|
} else {
|
|
1538
1484
|
var clonedHandle = handle['clone']();
|
|
1539
|
-
ptr = this.rawShare(ptr, Emval.toHandle(
|
|
1540
|
-
return clonedHandle['delete']();
|
|
1541
|
-
}));
|
|
1485
|
+
ptr = this.rawShare(ptr, Emval.toHandle(() => clonedHandle['delete']()));
|
|
1542
1486
|
if (destructors !== null) {
|
|
1543
1487
|
destructors.push(this.rawDestructor, ptr);
|
|
1544
1488
|
}
|
|
@@ -1572,15 +1516,15 @@ var WebRendererWasmFactory = function () {
|
|
|
1572
1516
|
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
1573
1517
|
return ptr;
|
|
1574
1518
|
}
|
|
1575
|
-
var init_RegisteredPointer =
|
|
1519
|
+
var init_RegisteredPointer = () => {
|
|
1576
1520
|
Object.assign(RegisteredPointer.prototype, {
|
|
1577
|
-
getPointee
|
|
1521
|
+
getPointee(ptr) {
|
|
1578
1522
|
if (this.rawGetPointee) {
|
|
1579
1523
|
ptr = this.rawGetPointee(ptr);
|
|
1580
1524
|
}
|
|
1581
1525
|
return ptr;
|
|
1582
1526
|
},
|
|
1583
|
-
destructor
|
|
1527
|
+
destructor(ptr) {
|
|
1584
1528
|
var _this$rawDestructor;
|
|
1585
1529
|
(_this$rawDestructor = this.rawDestructor) === null || _this$rawDestructor === void 0 || _this$rawDestructor.call(this, ptr);
|
|
1586
1530
|
},
|
|
@@ -1631,7 +1575,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1631
1575
|
}
|
|
1632
1576
|
|
|
1633
1577
|
/** @param {number=} numArguments */
|
|
1634
|
-
var replacePublicSymbol =
|
|
1578
|
+
var replacePublicSymbol = (name, value, numArguments) => {
|
|
1635
1579
|
if (!Module.hasOwnProperty(name)) {
|
|
1636
1580
|
throwInternalError('Replacing nonexistent public symbol');
|
|
1637
1581
|
}
|
|
@@ -1647,7 +1591,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1647
1591
|
|
|
1648
1592
|
/** @type {WebAssembly.Table} */
|
|
1649
1593
|
var wasmTable;
|
|
1650
|
-
var getWasmTableEntry =
|
|
1594
|
+
var getWasmTableEntry = funcPtr => {
|
|
1651
1595
|
var func = wasmTableMirror[funcPtr];
|
|
1652
1596
|
if (!func) {
|
|
1653
1597
|
if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1;
|
|
@@ -1656,7 +1600,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1656
1600
|
assert(wasmTable.get(funcPtr) == func, 'JavaScript-side Wasm function table mirror is out of date!');
|
|
1657
1601
|
return func;
|
|
1658
1602
|
};
|
|
1659
|
-
var embind__requireFunction =
|
|
1603
|
+
var embind__requireFunction = (signature, rawFunction) => {
|
|
1660
1604
|
signature = readLatin1String(signature);
|
|
1661
1605
|
function makeDynCaller() {
|
|
1662
1606
|
return getWasmTableEntry(rawFunction);
|
|
@@ -1667,7 +1611,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1667
1611
|
}
|
|
1668
1612
|
return fp;
|
|
1669
1613
|
};
|
|
1670
|
-
var extendError =
|
|
1614
|
+
var extendError = (baseErrorType, errorName) => {
|
|
1671
1615
|
var errorClass = createNamedFunction(errorName, function (message) {
|
|
1672
1616
|
this.name = errorName;
|
|
1673
1617
|
this.message = message;
|
|
@@ -1688,13 +1632,13 @@ var WebRendererWasmFactory = function () {
|
|
|
1688
1632
|
return errorClass;
|
|
1689
1633
|
};
|
|
1690
1634
|
var UnboundTypeError;
|
|
1691
|
-
var getTypeName =
|
|
1635
|
+
var getTypeName = type => {
|
|
1692
1636
|
var ptr = ___getTypeName(type);
|
|
1693
1637
|
var rv = readLatin1String(ptr);
|
|
1694
1638
|
_free(ptr);
|
|
1695
1639
|
return rv;
|
|
1696
1640
|
};
|
|
1697
|
-
var throwUnboundTypeError =
|
|
1641
|
+
var throwUnboundTypeError = (message, types) => {
|
|
1698
1642
|
var unboundTypes = [];
|
|
1699
1643
|
var seen = {};
|
|
1700
1644
|
function visit(type) {
|
|
@@ -1714,7 +1658,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1714
1658
|
types.forEach(visit);
|
|
1715
1659
|
throw new UnboundTypeError("".concat(message, ": ") + unboundTypes.map(getTypeName).join([', ']));
|
|
1716
1660
|
};
|
|
1717
|
-
var __embind_register_class =
|
|
1661
|
+
var __embind_register_class = (rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) => {
|
|
1718
1662
|
name = readLatin1String(name);
|
|
1719
1663
|
getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
|
|
1720
1664
|
upcast && (upcast = embind__requireFunction(upcastSignature, upcast));
|
|
@@ -1725,7 +1669,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1725
1669
|
// this code cannot run if baseClassRawType is zero
|
|
1726
1670
|
throwUnboundTypeError("Cannot construct ".concat(name, " due to unbound types"), [baseClassRawType]);
|
|
1727
1671
|
});
|
|
1728
|
-
whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [],
|
|
1672
|
+
whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], base => {
|
|
1729
1673
|
base = base[0];
|
|
1730
1674
|
var baseClass;
|
|
1731
1675
|
var basePrototype;
|
|
@@ -1787,7 +1731,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1787
1731
|
}
|
|
1788
1732
|
function newFunc(constructor, argumentList) {
|
|
1789
1733
|
if (!(constructor instanceof Function)) {
|
|
1790
|
-
throw new TypeError("new_ called with constructor type ".concat(
|
|
1734
|
+
throw new TypeError("new_ called with constructor type ".concat(typeof constructor, " which is not a function"));
|
|
1791
1735
|
}
|
|
1792
1736
|
/*
|
|
1793
1737
|
* Previously, the following line was just:
|
|
@@ -1892,15 +1836,12 @@ var WebRendererWasmFactory = function () {
|
|
|
1892
1836
|
}
|
|
1893
1837
|
}
|
|
1894
1838
|
}
|
|
1895
|
-
var
|
|
1896
|
-
_createJsInvoker2 = _slicedToArray(_createJsInvoker, 2),
|
|
1897
|
-
args = _createJsInvoker2[0],
|
|
1898
|
-
invokerFnBody = _createJsInvoker2[1];
|
|
1839
|
+
var [args, invokerFnBody] = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync);
|
|
1899
1840
|
args.push(invokerFnBody);
|
|
1900
|
-
var invokerFn = newFunc(Function, args)
|
|
1841
|
+
var invokerFn = newFunc(Function, args)(...closureArgs);
|
|
1901
1842
|
return createNamedFunction(humanName, invokerFn);
|
|
1902
1843
|
}
|
|
1903
|
-
var heap32VectorToArray =
|
|
1844
|
+
var heap32VectorToArray = (count, firstElement) => {
|
|
1904
1845
|
var array = [];
|
|
1905
1846
|
for (var i = 0; i < count; i++) {
|
|
1906
1847
|
// TODO(https://github.com/emscripten-core/emscripten/issues/17310):
|
|
@@ -1909,7 +1850,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1909
1850
|
}
|
|
1910
1851
|
return array;
|
|
1911
1852
|
};
|
|
1912
|
-
var getFunctionName =
|
|
1853
|
+
var getFunctionName = signature => {
|
|
1913
1854
|
signature = signature.trim();
|
|
1914
1855
|
var argsIndex = signature.indexOf("(");
|
|
1915
1856
|
if (argsIndex !== -1) {
|
|
@@ -1919,12 +1860,12 @@ var WebRendererWasmFactory = function () {
|
|
|
1919
1860
|
return signature;
|
|
1920
1861
|
}
|
|
1921
1862
|
};
|
|
1922
|
-
var __embind_register_class_class_function =
|
|
1863
|
+
var __embind_register_class_class_function = (rawClassType, methodName, argCount, rawArgTypesAddr, invokerSignature, rawInvoker, fn, isAsync) => {
|
|
1923
1864
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
1924
1865
|
methodName = readLatin1String(methodName);
|
|
1925
1866
|
methodName = getFunctionName(methodName);
|
|
1926
1867
|
rawInvoker = embind__requireFunction(invokerSignature, rawInvoker);
|
|
1927
|
-
whenDependentTypesAreResolved([], [rawClassType],
|
|
1868
|
+
whenDependentTypesAreResolved([], [rawClassType], classType => {
|
|
1928
1869
|
classType = classType[0];
|
|
1929
1870
|
var humanName = "".concat(classType.name, ".").concat(methodName);
|
|
1930
1871
|
function unboundTypesHandler() {
|
|
@@ -1944,7 +1885,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1944
1885
|
ensureOverloadTable(proto, methodName, humanName);
|
|
1945
1886
|
proto[methodName].overloadTable[argCount - 1] = unboundTypesHandler;
|
|
1946
1887
|
}
|
|
1947
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1888
|
+
whenDependentTypesAreResolved([], rawArgTypes, argTypes => {
|
|
1948
1889
|
// Replace the initial unbound-types-handler stub with the proper
|
|
1949
1890
|
// function. If multiple overloads are registered, the function handlers
|
|
1950
1891
|
// go into an overload table.
|
|
@@ -1957,20 +1898,11 @@ var WebRendererWasmFactory = function () {
|
|
|
1957
1898
|
proto[methodName].overloadTable[argCount - 1] = func;
|
|
1958
1899
|
}
|
|
1959
1900
|
if (classType.registeredClass.__derivedClasses) {
|
|
1960
|
-
var
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
var derivedClass = _step.value;
|
|
1965
|
-
if (!derivedClass.constructor.hasOwnProperty(methodName)) {
|
|
1966
|
-
// TODO: Add support for overloads
|
|
1967
|
-
derivedClass.constructor[methodName] = func;
|
|
1968
|
-
}
|
|
1901
|
+
for (var derivedClass of classType.registeredClass.__derivedClasses) {
|
|
1902
|
+
if (!derivedClass.constructor.hasOwnProperty(methodName)) {
|
|
1903
|
+
// TODO: Add support for overloads
|
|
1904
|
+
derivedClass.constructor[methodName] = func;
|
|
1969
1905
|
}
|
|
1970
|
-
} catch (err) {
|
|
1971
|
-
_iterator.e(err);
|
|
1972
|
-
} finally {
|
|
1973
|
-
_iterator.f();
|
|
1974
1906
|
}
|
|
1975
1907
|
}
|
|
1976
1908
|
return [];
|
|
@@ -1978,11 +1910,11 @@ var WebRendererWasmFactory = function () {
|
|
|
1978
1910
|
return [];
|
|
1979
1911
|
});
|
|
1980
1912
|
};
|
|
1981
|
-
var __embind_register_class_constructor =
|
|
1913
|
+
var __embind_register_class_constructor = (rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) => {
|
|
1982
1914
|
assert(argCount > 0);
|
|
1983
1915
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
1984
1916
|
invoker = embind__requireFunction(invokerSignature, invoker);
|
|
1985
|
-
whenDependentTypesAreResolved([], [rawClassType],
|
|
1917
|
+
whenDependentTypesAreResolved([], [rawClassType], classType => {
|
|
1986
1918
|
classType = classType[0];
|
|
1987
1919
|
var humanName = "constructor ".concat(classType.name);
|
|
1988
1920
|
if (undefined === classType.registeredClass.constructor_body) {
|
|
@@ -1991,10 +1923,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1991
1923
|
if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {
|
|
1992
1924
|
throw new BindingError("Cannot register multiple constructors with identical number of parameters (".concat(argCount - 1, ") for class '").concat(classType.name, "'! Overload resolution is currently only performed using the parameter count, not actual type info!"));
|
|
1993
1925
|
}
|
|
1994
|
-
classType.registeredClass.constructor_body[argCount - 1] =
|
|
1926
|
+
classType.registeredClass.constructor_body[argCount - 1] = () => {
|
|
1995
1927
|
throwUnboundTypeError("Cannot construct ".concat(classType.name, " due to unbound types"), rawArgTypes);
|
|
1996
1928
|
};
|
|
1997
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1929
|
+
whenDependentTypesAreResolved([], rawArgTypes, argTypes => {
|
|
1998
1930
|
// Insert empty slot for context type (argTypes[1]).
|
|
1999
1931
|
argTypes.splice(1, 0, null);
|
|
2000
1932
|
classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor);
|
|
@@ -2003,14 +1935,14 @@ var WebRendererWasmFactory = function () {
|
|
|
2003
1935
|
return [];
|
|
2004
1936
|
});
|
|
2005
1937
|
};
|
|
2006
|
-
var __embind_register_class_function =
|
|
1938
|
+
var __embind_register_class_function = (rawClassType, methodName, argCount, rawArgTypesAddr,
|
|
2007
1939
|
// [ReturnType, ThisType, Args...]
|
|
2008
|
-
invokerSignature, rawInvoker, context, isPureVirtual, isAsync) {
|
|
1940
|
+
invokerSignature, rawInvoker, context, isPureVirtual, isAsync) => {
|
|
2009
1941
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
2010
1942
|
methodName = readLatin1String(methodName);
|
|
2011
1943
|
methodName = getFunctionName(methodName);
|
|
2012
1944
|
rawInvoker = embind__requireFunction(invokerSignature, rawInvoker);
|
|
2013
|
-
whenDependentTypesAreResolved([], [rawClassType],
|
|
1945
|
+
whenDependentTypesAreResolved([], [rawClassType], classType => {
|
|
2014
1946
|
classType = classType[0];
|
|
2015
1947
|
var humanName = "".concat(classType.name, ".").concat(methodName);
|
|
2016
1948
|
if (methodName.startsWith("@@")) {
|
|
@@ -2036,7 +1968,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2036
1968
|
ensureOverloadTable(proto, methodName, humanName);
|
|
2037
1969
|
proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler;
|
|
2038
1970
|
}
|
|
2039
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1971
|
+
whenDependentTypesAreResolved([], rawArgTypes, argTypes => {
|
|
2040
1972
|
var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context, isAsync);
|
|
2041
1973
|
|
|
2042
1974
|
// Replace the initial unbound-handler-stub function with the
|
|
@@ -2055,7 +1987,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2055
1987
|
return [];
|
|
2056
1988
|
});
|
|
2057
1989
|
};
|
|
2058
|
-
var validateThis =
|
|
1990
|
+
var validateThis = (this_, classType, humanName) => {
|
|
2059
1991
|
if (!(this_ instanceof Object)) {
|
|
2060
1992
|
throwBindingError("".concat(humanName, " with invalid \"this\": ").concat(this_));
|
|
2061
1993
|
}
|
|
@@ -2069,33 +2001,29 @@ var WebRendererWasmFactory = function () {
|
|
|
2069
2001
|
// todo: kill this
|
|
2070
2002
|
return upcastPointer(this_.$$.ptr, this_.$$.ptrType.registeredClass, classType.registeredClass);
|
|
2071
2003
|
};
|
|
2072
|
-
var __embind_register_class_property =
|
|
2004
|
+
var __embind_register_class_property = (classType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => {
|
|
2073
2005
|
fieldName = readLatin1String(fieldName);
|
|
2074
2006
|
getter = embind__requireFunction(getterSignature, getter);
|
|
2075
|
-
whenDependentTypesAreResolved([], [classType],
|
|
2007
|
+
whenDependentTypesAreResolved([], [classType], classType => {
|
|
2076
2008
|
classType = classType[0];
|
|
2077
2009
|
var humanName = "".concat(classType.name, ".").concat(fieldName);
|
|
2078
2010
|
var desc = {
|
|
2079
|
-
get
|
|
2011
|
+
get() {
|
|
2080
2012
|
throwUnboundTypeError("Cannot access ".concat(humanName, " due to unbound types"), [getterReturnType, setterArgumentType]);
|
|
2081
2013
|
},
|
|
2082
2014
|
enumerable: true,
|
|
2083
2015
|
configurable: true
|
|
2084
2016
|
};
|
|
2085
2017
|
if (setter) {
|
|
2086
|
-
desc.set =
|
|
2087
|
-
return throwUnboundTypeError("Cannot access ".concat(humanName, " due to unbound types"), [getterReturnType, setterArgumentType]);
|
|
2088
|
-
};
|
|
2018
|
+
desc.set = () => throwUnboundTypeError("Cannot access ".concat(humanName, " due to unbound types"), [getterReturnType, setterArgumentType]);
|
|
2089
2019
|
} else {
|
|
2090
|
-
desc.set =
|
|
2091
|
-
return throwBindingError(humanName + ' is a read-only property');
|
|
2092
|
-
};
|
|
2020
|
+
desc.set = v => throwBindingError(humanName + ' is a read-only property');
|
|
2093
2021
|
}
|
|
2094
2022
|
Object.defineProperty(classType.registeredClass.instancePrototype, fieldName, desc);
|
|
2095
|
-
whenDependentTypesAreResolved([], setter ? [getterReturnType, setterArgumentType] : [getterReturnType],
|
|
2023
|
+
whenDependentTypesAreResolved([], setter ? [getterReturnType, setterArgumentType] : [getterReturnType], types => {
|
|
2096
2024
|
var getterReturnType = types[0];
|
|
2097
2025
|
var desc = {
|
|
2098
|
-
get
|
|
2026
|
+
get() {
|
|
2099
2027
|
var ptr = validateThis(this, classType, humanName + ' getter');
|
|
2100
2028
|
return getterReturnType['fromWireType'](getter(getterContext, ptr));
|
|
2101
2029
|
},
|
|
@@ -2119,24 +2047,24 @@ var WebRendererWasmFactory = function () {
|
|
|
2119
2047
|
};
|
|
2120
2048
|
var emval_freelist = [];
|
|
2121
2049
|
var emval_handles = [];
|
|
2122
|
-
var __emval_decref =
|
|
2050
|
+
var __emval_decref = handle => {
|
|
2123
2051
|
if (handle > 9 && 0 === --emval_handles[handle + 1]) {
|
|
2124
2052
|
assert(emval_handles[handle] !== undefined, "Decref for unallocated handle.");
|
|
2125
2053
|
emval_handles[handle] = undefined;
|
|
2126
2054
|
emval_freelist.push(handle);
|
|
2127
2055
|
}
|
|
2128
2056
|
};
|
|
2129
|
-
var count_emval_handles =
|
|
2057
|
+
var count_emval_handles = () => {
|
|
2130
2058
|
return emval_handles.length / 2 - 5 - emval_freelist.length;
|
|
2131
2059
|
};
|
|
2132
|
-
var init_emval =
|
|
2060
|
+
var init_emval = () => {
|
|
2133
2061
|
// reserve 0 and some special values. These never get de-allocated.
|
|
2134
2062
|
emval_handles.push(0, 1, undefined, 1, null, 1, true, 1, false, 1);
|
|
2135
2063
|
assert(emval_handles.length === 5 * 2);
|
|
2136
2064
|
Module['count_emval_handles'] = count_emval_handles;
|
|
2137
2065
|
};
|
|
2138
2066
|
var Emval = {
|
|
2139
|
-
toValue:
|
|
2067
|
+
toValue: handle => {
|
|
2140
2068
|
if (!handle) {
|
|
2141
2069
|
throwBindingError('Cannot use deleted val. handle = ' + handle);
|
|
2142
2070
|
}
|
|
@@ -2144,7 +2072,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2144
2072
|
assert(handle === 2 || emval_handles[handle] !== undefined && handle % 2 === 0, "invalid handle: ".concat(handle));
|
|
2145
2073
|
return emval_handles[handle];
|
|
2146
2074
|
},
|
|
2147
|
-
toHandle:
|
|
2075
|
+
toHandle: value => {
|
|
2148
2076
|
switch (value) {
|
|
2149
2077
|
case undefined:
|
|
2150
2078
|
return 2;
|
|
@@ -2166,14 +2094,12 @@ var WebRendererWasmFactory = function () {
|
|
|
2166
2094
|
};
|
|
2167
2095
|
var EmValType = {
|
|
2168
2096
|
name: 'emscripten::val',
|
|
2169
|
-
'fromWireType':
|
|
2097
|
+
'fromWireType': handle => {
|
|
2170
2098
|
var rv = Emval.toValue(handle);
|
|
2171
2099
|
__emval_decref(handle);
|
|
2172
2100
|
return rv;
|
|
2173
2101
|
},
|
|
2174
|
-
'toWireType':
|
|
2175
|
-
return Emval.toHandle(value);
|
|
2176
|
-
},
|
|
2102
|
+
'toWireType': (destructors, value) => Emval.toHandle(value),
|
|
2177
2103
|
'argPackAdvance': GenericWireTypeSize,
|
|
2178
2104
|
'readValueFromPointer': readPointer,
|
|
2179
2105
|
destructorFunction: null // This type does not need a destructor
|
|
@@ -2181,10 +2107,8 @@ var WebRendererWasmFactory = function () {
|
|
|
2181
2107
|
// TODO: do we need a deleteObject here? write a test where
|
|
2182
2108
|
// emval is passed into JS via an interface
|
|
2183
2109
|
};
|
|
2184
|
-
var __embind_register_emval =
|
|
2185
|
-
|
|
2186
|
-
};
|
|
2187
|
-
var enumReadValueFromPointer = function enumReadValueFromPointer(name, width, signed) {
|
|
2110
|
+
var __embind_register_emval = rawType => registerType(rawType, EmValType);
|
|
2111
|
+
var enumReadValueFromPointer = (name, width, signed) => {
|
|
2188
2112
|
switch (width) {
|
|
2189
2113
|
case 1:
|
|
2190
2114
|
return signed ? function (pointer) {
|
|
@@ -2210,33 +2134,31 @@ var WebRendererWasmFactory = function () {
|
|
|
2210
2134
|
};
|
|
2211
2135
|
|
|
2212
2136
|
/** @suppress {globalThis} */
|
|
2213
|
-
var __embind_register_enum =
|
|
2137
|
+
var __embind_register_enum = (rawType, name, size, isSigned) => {
|
|
2214
2138
|
name = readLatin1String(name);
|
|
2215
2139
|
function ctor() {}
|
|
2216
2140
|
ctor.values = {};
|
|
2217
2141
|
registerType(rawType, {
|
|
2218
|
-
name
|
|
2142
|
+
name,
|
|
2219
2143
|
constructor: ctor,
|
|
2220
2144
|
'fromWireType': function fromWireType(c) {
|
|
2221
2145
|
return this.constructor.values[c];
|
|
2222
2146
|
},
|
|
2223
|
-
'toWireType':
|
|
2224
|
-
return c.value;
|
|
2225
|
-
},
|
|
2147
|
+
'toWireType': (destructors, c) => c.value,
|
|
2226
2148
|
'argPackAdvance': GenericWireTypeSize,
|
|
2227
2149
|
'readValueFromPointer': enumReadValueFromPointer(name, size, isSigned),
|
|
2228
2150
|
destructorFunction: null
|
|
2229
2151
|
});
|
|
2230
2152
|
exposePublicSymbol(name, ctor);
|
|
2231
2153
|
};
|
|
2232
|
-
var requireRegisteredType =
|
|
2154
|
+
var requireRegisteredType = (rawType, humanName) => {
|
|
2233
2155
|
var impl = registeredTypes[rawType];
|
|
2234
2156
|
if (undefined === impl) {
|
|
2235
2157
|
throwBindingError("".concat(humanName, " has unknown type ").concat(getTypeName(rawType)));
|
|
2236
2158
|
}
|
|
2237
2159
|
return impl;
|
|
2238
2160
|
};
|
|
2239
|
-
var __embind_register_enum_value =
|
|
2161
|
+
var __embind_register_enum_value = (rawEnumType, name, enumValue) => {
|
|
2240
2162
|
var enumType = requireRegisteredType(rawEnumType, 'enum');
|
|
2241
2163
|
name = readLatin1String(name);
|
|
2242
2164
|
var Enum = enumType.constructor;
|
|
@@ -2251,7 +2173,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2251
2173
|
Enum.values[enumValue] = Value;
|
|
2252
2174
|
Enum[name] = Value;
|
|
2253
2175
|
};
|
|
2254
|
-
var floatReadValueFromPointer =
|
|
2176
|
+
var floatReadValueFromPointer = (name, width) => {
|
|
2255
2177
|
switch (width) {
|
|
2256
2178
|
case 4:
|
|
2257
2179
|
return function (pointer) {
|
|
@@ -2265,16 +2187,14 @@ var WebRendererWasmFactory = function () {
|
|
|
2265
2187
|
throw new TypeError("invalid float width (".concat(width, "): ").concat(name));
|
|
2266
2188
|
}
|
|
2267
2189
|
};
|
|
2268
|
-
var __embind_register_float =
|
|
2190
|
+
var __embind_register_float = (rawType, name, size) => {
|
|
2269
2191
|
name = readLatin1String(name);
|
|
2270
2192
|
registerType(rawType, {
|
|
2271
|
-
name
|
|
2272
|
-
'fromWireType':
|
|
2273
|
-
|
|
2274
|
-
},
|
|
2275
|
-
'toWireType': function toWireType(destructors, value) {
|
|
2193
|
+
name,
|
|
2194
|
+
'fromWireType': value => value,
|
|
2195
|
+
'toWireType': (destructors, value) => {
|
|
2276
2196
|
if (typeof value != "number" && typeof value != "boolean") {
|
|
2277
|
-
throw new TypeError("Cannot convert ".concat(embindRepr(value), " to ").concat(
|
|
2197
|
+
throw new TypeError("Cannot convert ".concat(embindRepr(value), " to ").concat(this.name));
|
|
2278
2198
|
}
|
|
2279
2199
|
// The VM will perform JS to Wasm value conversion, according to the spec:
|
|
2280
2200
|
// https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
|
|
@@ -2287,24 +2207,20 @@ var WebRendererWasmFactory = function () {
|
|
|
2287
2207
|
};
|
|
2288
2208
|
|
|
2289
2209
|
/** @suppress {globalThis} */
|
|
2290
|
-
var __embind_register_integer =
|
|
2210
|
+
var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => {
|
|
2291
2211
|
name = readLatin1String(name);
|
|
2292
2212
|
// LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come
|
|
2293
2213
|
// out as 'i32 -1'. Always treat those as max u32.
|
|
2294
2214
|
if (maxRange === -1) {
|
|
2295
2215
|
maxRange = 4294967295;
|
|
2296
2216
|
}
|
|
2297
|
-
var fromWireType =
|
|
2298
|
-
return value;
|
|
2299
|
-
};
|
|
2217
|
+
var fromWireType = value => value;
|
|
2300
2218
|
if (minRange === 0) {
|
|
2301
2219
|
var bitshift = 32 - 8 * size;
|
|
2302
|
-
fromWireType =
|
|
2303
|
-
return value << bitshift >>> bitshift;
|
|
2304
|
-
};
|
|
2220
|
+
fromWireType = value => value << bitshift >>> bitshift;
|
|
2305
2221
|
}
|
|
2306
2222
|
var isUnsignedType = name.includes('unsigned');
|
|
2307
|
-
var checkAssertions =
|
|
2223
|
+
var checkAssertions = (value, toTypeName) => {
|
|
2308
2224
|
if (typeof value != "number" && typeof value != "boolean") {
|
|
2309
2225
|
throw new TypeError("Cannot convert \"".concat(embindRepr(value), "\" to ").concat(toTypeName));
|
|
2310
2226
|
}
|
|
@@ -2327,7 +2243,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2327
2243
|
};
|
|
2328
2244
|
}
|
|
2329
2245
|
registerType(primitiveType, {
|
|
2330
|
-
name
|
|
2246
|
+
name,
|
|
2331
2247
|
'fromWireType': fromWireType,
|
|
2332
2248
|
'toWireType': toWireType,
|
|
2333
2249
|
'argPackAdvance': GenericWireTypeSize,
|
|
@@ -2335,7 +2251,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2335
2251
|
destructorFunction: null // This type does not need a destructor
|
|
2336
2252
|
});
|
|
2337
2253
|
};
|
|
2338
|
-
var __embind_register_memory_view =
|
|
2254
|
+
var __embind_register_memory_view = (rawType, dataTypeIndex, name) => {
|
|
2339
2255
|
var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array];
|
|
2340
2256
|
var TA = typeMapping[dataTypeIndex];
|
|
2341
2257
|
function decodeMemoryView(handle) {
|
|
@@ -2345,7 +2261,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2345
2261
|
}
|
|
2346
2262
|
name = readLatin1String(name);
|
|
2347
2263
|
registerType(rawType, {
|
|
2348
|
-
name
|
|
2264
|
+
name,
|
|
2349
2265
|
'fromWireType': decodeMemoryView,
|
|
2350
2266
|
'argPackAdvance': GenericWireTypeSize,
|
|
2351
2267
|
'readValueFromPointer': decodeMemoryView
|
|
@@ -2353,16 +2269,16 @@ var WebRendererWasmFactory = function () {
|
|
|
2353
2269
|
ignoreDuplicateRegistrations: true
|
|
2354
2270
|
});
|
|
2355
2271
|
};
|
|
2356
|
-
var __embind_register_optional =
|
|
2272
|
+
var __embind_register_optional = (rawOptionalType, rawType) => {
|
|
2357
2273
|
__embind_register_emval(rawOptionalType);
|
|
2358
2274
|
};
|
|
2359
|
-
var __embind_register_smart_ptr =
|
|
2275
|
+
var __embind_register_smart_ptr = (rawType, rawPointeeType, name, sharingPolicy, getPointeeSignature, rawGetPointee, constructorSignature, rawConstructor, shareSignature, rawShare, destructorSignature, rawDestructor) => {
|
|
2360
2276
|
name = readLatin1String(name);
|
|
2361
2277
|
rawGetPointee = embind__requireFunction(getPointeeSignature, rawGetPointee);
|
|
2362
2278
|
rawConstructor = embind__requireFunction(constructorSignature, rawConstructor);
|
|
2363
2279
|
rawShare = embind__requireFunction(shareSignature, rawShare);
|
|
2364
2280
|
rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
|
|
2365
|
-
whenDependentTypesAreResolved([rawType], [rawPointeeType],
|
|
2281
|
+
whenDependentTypesAreResolved([rawType], [rawPointeeType], pointeeType => {
|
|
2366
2282
|
pointeeType = pointeeType[0];
|
|
2367
2283
|
var registeredPointer = new RegisteredPointer(name, pointeeType.registeredClass, false, false,
|
|
2368
2284
|
// smart pointer properties
|
|
@@ -2370,8 +2286,8 @@ var WebRendererWasmFactory = function () {
|
|
|
2370
2286
|
return [registeredPointer];
|
|
2371
2287
|
});
|
|
2372
2288
|
};
|
|
2373
|
-
var stringToUTF8Array =
|
|
2374
|
-
assert(typeof str === 'string', "stringToUTF8Array expects a string (got ".concat(
|
|
2289
|
+
var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
|
|
2290
|
+
assert(typeof str === 'string', "stringToUTF8Array expects a string (got ".concat(typeof str, ")"));
|
|
2375
2291
|
// Parameter maxBytesToWrite is not optional. Negative values, 0, null,
|
|
2376
2292
|
// undefined and false each don't write out any bytes.
|
|
2377
2293
|
if (!(maxBytesToWrite > 0)) return 0;
|
|
@@ -2404,7 +2320,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2404
2320
|
heap[outIdx++] = 0x80 | u & 63;
|
|
2405
2321
|
} else {
|
|
2406
2322
|
if (outIdx + 3 >= endIdx) break;
|
|
2407
|
-
if (u > 0x10FFFF)
|
|
2323
|
+
if (u > 0x10FFFF) warnOnce('Invalid Unicode code point ' + ptrToString(u) + ' encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).');
|
|
2408
2324
|
heap[outIdx++] = 0xF0 | u >> 18;
|
|
2409
2325
|
heap[outIdx++] = 0x80 | u >> 12 & 63;
|
|
2410
2326
|
heap[outIdx++] = 0x80 | u >> 6 & 63;
|
|
@@ -2415,11 +2331,11 @@ var WebRendererWasmFactory = function () {
|
|
|
2415
2331
|
heap[outIdx] = 0;
|
|
2416
2332
|
return outIdx - startIdx;
|
|
2417
2333
|
};
|
|
2418
|
-
var stringToUTF8 =
|
|
2334
|
+
var stringToUTF8 = (str, outPtr, maxBytesToWrite) => {
|
|
2419
2335
|
assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
|
|
2420
2336
|
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
2421
2337
|
};
|
|
2422
|
-
var lengthBytesUTF8 =
|
|
2338
|
+
var lengthBytesUTF8 = str => {
|
|
2423
2339
|
var len = 0;
|
|
2424
2340
|
for (var i = 0; i < str.length; ++i) {
|
|
2425
2341
|
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
|
|
@@ -2440,16 +2356,16 @@ var WebRendererWasmFactory = function () {
|
|
|
2440
2356
|
}
|
|
2441
2357
|
return len;
|
|
2442
2358
|
};
|
|
2443
|
-
var __embind_register_std_string =
|
|
2359
|
+
var __embind_register_std_string = (rawType, name) => {
|
|
2444
2360
|
name = readLatin1String(name);
|
|
2445
2361
|
var stdStringIsUTF8
|
|
2446
2362
|
//process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string<unsigned char>
|
|
2447
2363
|
= name === "std::string";
|
|
2448
2364
|
registerType(rawType, {
|
|
2449
|
-
name
|
|
2365
|
+
name,
|
|
2450
2366
|
// For some method names we use string keys here since they are part of
|
|
2451
2367
|
// the public/external API and/or used by the runtime-generated code.
|
|
2452
|
-
'fromWireType'
|
|
2368
|
+
'fromWireType'(value) {
|
|
2453
2369
|
var length = HEAPU32[value >> 2];
|
|
2454
2370
|
var payload = value + 4;
|
|
2455
2371
|
var str;
|
|
@@ -2480,7 +2396,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2480
2396
|
_free(value);
|
|
2481
2397
|
return str;
|
|
2482
2398
|
},
|
|
2483
|
-
'toWireType'
|
|
2399
|
+
'toWireType'(destructors, value) {
|
|
2484
2400
|
if (value instanceof ArrayBuffer) {
|
|
2485
2401
|
value = new Uint8Array(value);
|
|
2486
2402
|
}
|
|
@@ -2524,13 +2440,13 @@ var WebRendererWasmFactory = function () {
|
|
|
2524
2440
|
},
|
|
2525
2441
|
'argPackAdvance': GenericWireTypeSize,
|
|
2526
2442
|
'readValueFromPointer': readPointer,
|
|
2527
|
-
destructorFunction
|
|
2443
|
+
destructorFunction(ptr) {
|
|
2528
2444
|
_free(ptr);
|
|
2529
2445
|
}
|
|
2530
2446
|
});
|
|
2531
2447
|
};
|
|
2532
2448
|
var UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined;
|
|
2533
|
-
var UTF16ToString =
|
|
2449
|
+
var UTF16ToString = (ptr, maxBytesToRead) => {
|
|
2534
2450
|
assert(ptr % 2 == 0, 'Pointer passed to UTF16ToString must be aligned to two bytes!');
|
|
2535
2451
|
var endPtr = ptr;
|
|
2536
2452
|
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
|
@@ -2560,7 +2476,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2560
2476
|
}
|
|
2561
2477
|
return str;
|
|
2562
2478
|
};
|
|
2563
|
-
var stringToUTF16 =
|
|
2479
|
+
var stringToUTF16 = (str, outPtr, maxBytesToWrite) => {
|
|
2564
2480
|
var _maxBytesToWrite;
|
|
2565
2481
|
assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!');
|
|
2566
2482
|
assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
|
|
@@ -2580,10 +2496,10 @@ var WebRendererWasmFactory = function () {
|
|
|
2580
2496
|
HEAP16[outPtr >> 1] = 0;
|
|
2581
2497
|
return outPtr - startPtr;
|
|
2582
2498
|
};
|
|
2583
|
-
var lengthBytesUTF16 =
|
|
2499
|
+
var lengthBytesUTF16 = str => {
|
|
2584
2500
|
return str.length * 2;
|
|
2585
2501
|
};
|
|
2586
|
-
var UTF32ToString =
|
|
2502
|
+
var UTF32ToString = (ptr, maxBytesToRead) => {
|
|
2587
2503
|
assert(ptr % 4 == 0, 'Pointer passed to UTF32ToString must be aligned to four bytes!');
|
|
2588
2504
|
var i = 0;
|
|
2589
2505
|
var str = '';
|
|
@@ -2604,7 +2520,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2604
2520
|
}
|
|
2605
2521
|
return str;
|
|
2606
2522
|
};
|
|
2607
|
-
var stringToUTF32 =
|
|
2523
|
+
var stringToUTF32 = (str, outPtr, maxBytesToWrite) => {
|
|
2608
2524
|
var _maxBytesToWrite2;
|
|
2609
2525
|
assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!');
|
|
2610
2526
|
assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
|
|
@@ -2629,7 +2545,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2629
2545
|
HEAP32[outPtr >> 2] = 0;
|
|
2630
2546
|
return outPtr - startPtr;
|
|
2631
2547
|
};
|
|
2632
|
-
var lengthBytesUTF32 =
|
|
2548
|
+
var lengthBytesUTF32 = str => {
|
|
2633
2549
|
var len = 0;
|
|
2634
2550
|
for (var i = 0; i < str.length; ++i) {
|
|
2635
2551
|
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
|
|
@@ -2640,27 +2556,23 @@ var WebRendererWasmFactory = function () {
|
|
|
2640
2556
|
}
|
|
2641
2557
|
return len;
|
|
2642
2558
|
};
|
|
2643
|
-
var __embind_register_std_wstring =
|
|
2559
|
+
var __embind_register_std_wstring = (rawType, charSize, name) => {
|
|
2644
2560
|
name = readLatin1String(name);
|
|
2645
2561
|
var decodeString, encodeString, readCharAt, lengthBytesUTF;
|
|
2646
2562
|
if (charSize === 2) {
|
|
2647
2563
|
decodeString = UTF16ToString;
|
|
2648
2564
|
encodeString = stringToUTF16;
|
|
2649
2565
|
lengthBytesUTF = lengthBytesUTF16;
|
|
2650
|
-
readCharAt =
|
|
2651
|
-
return HEAPU16[pointer >> 1];
|
|
2652
|
-
};
|
|
2566
|
+
readCharAt = pointer => HEAPU16[pointer >> 1];
|
|
2653
2567
|
} else if (charSize === 4) {
|
|
2654
2568
|
decodeString = UTF32ToString;
|
|
2655
2569
|
encodeString = stringToUTF32;
|
|
2656
2570
|
lengthBytesUTF = lengthBytesUTF32;
|
|
2657
|
-
readCharAt =
|
|
2658
|
-
return HEAPU32[pointer >> 2];
|
|
2659
|
-
};
|
|
2571
|
+
readCharAt = pointer => HEAPU32[pointer >> 2];
|
|
2660
2572
|
}
|
|
2661
2573
|
registerType(rawType, {
|
|
2662
|
-
name
|
|
2663
|
-
'fromWireType':
|
|
2574
|
+
name,
|
|
2575
|
+
'fromWireType': value => {
|
|
2664
2576
|
// Code mostly taken from _embind_register_std_string fromWireType
|
|
2665
2577
|
var length = HEAPU32[value >> 2];
|
|
2666
2578
|
var str;
|
|
@@ -2683,7 +2595,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2683
2595
|
_free(value);
|
|
2684
2596
|
return str;
|
|
2685
2597
|
},
|
|
2686
|
-
'toWireType':
|
|
2598
|
+
'toWireType': (destructors, value) => {
|
|
2687
2599
|
if (!(typeof value == 'string')) {
|
|
2688
2600
|
throwBindingError("Cannot pass non-string to C++ string type ".concat(name));
|
|
2689
2601
|
}
|
|
@@ -2700,12 +2612,12 @@ var WebRendererWasmFactory = function () {
|
|
|
2700
2612
|
},
|
|
2701
2613
|
'argPackAdvance': GenericWireTypeSize,
|
|
2702
2614
|
'readValueFromPointer': readPointer,
|
|
2703
|
-
destructorFunction
|
|
2615
|
+
destructorFunction(ptr) {
|
|
2704
2616
|
_free(ptr);
|
|
2705
2617
|
}
|
|
2706
2618
|
});
|
|
2707
2619
|
};
|
|
2708
|
-
var __embind_register_value_object =
|
|
2620
|
+
var __embind_register_value_object = (rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) => {
|
|
2709
2621
|
structRegistrations[rawType] = {
|
|
2710
2622
|
name: readLatin1String(name),
|
|
2711
2623
|
rawConstructor: embind__requireFunction(constructorSignature, rawConstructor),
|
|
@@ -2713,41 +2625,35 @@ var WebRendererWasmFactory = function () {
|
|
|
2713
2625
|
fields: []
|
|
2714
2626
|
};
|
|
2715
2627
|
};
|
|
2716
|
-
var __embind_register_value_object_field =
|
|
2628
|
+
var __embind_register_value_object_field = (structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => {
|
|
2717
2629
|
structRegistrations[structType].fields.push({
|
|
2718
2630
|
fieldName: readLatin1String(fieldName),
|
|
2719
|
-
getterReturnType
|
|
2631
|
+
getterReturnType,
|
|
2720
2632
|
getter: embind__requireFunction(getterSignature, getter),
|
|
2721
|
-
getterContext
|
|
2722
|
-
setterArgumentType
|
|
2633
|
+
getterContext,
|
|
2634
|
+
setterArgumentType,
|
|
2723
2635
|
setter: embind__requireFunction(setterSignature, setter),
|
|
2724
|
-
setterContext
|
|
2636
|
+
setterContext
|
|
2725
2637
|
});
|
|
2726
2638
|
};
|
|
2727
|
-
var __embind_register_void =
|
|
2639
|
+
var __embind_register_void = (rawType, name) => {
|
|
2728
2640
|
name = readLatin1String(name);
|
|
2729
2641
|
registerType(rawType, {
|
|
2730
2642
|
isVoid: true,
|
|
2731
2643
|
// void return values can be optimized out sometimes
|
|
2732
|
-
name
|
|
2644
|
+
name,
|
|
2733
2645
|
'argPackAdvance': 0,
|
|
2734
|
-
'fromWireType':
|
|
2735
|
-
return undefined;
|
|
2736
|
-
},
|
|
2646
|
+
'fromWireType': () => undefined,
|
|
2737
2647
|
// TODO: assert if anything else is given?
|
|
2738
|
-
'toWireType':
|
|
2739
|
-
return undefined;
|
|
2740
|
-
}
|
|
2648
|
+
'toWireType': (destructors, o) => undefined
|
|
2741
2649
|
});
|
|
2742
2650
|
};
|
|
2743
2651
|
var nowIsMonotonic = 1;
|
|
2744
|
-
var __emscripten_get_now_is_monotonic =
|
|
2745
|
-
|
|
2746
|
-
};
|
|
2747
|
-
var __emscripten_throw_longjmp = function __emscripten_throw_longjmp() {
|
|
2652
|
+
var __emscripten_get_now_is_monotonic = () => nowIsMonotonic;
|
|
2653
|
+
var __emscripten_throw_longjmp = () => {
|
|
2748
2654
|
throw Infinity;
|
|
2749
2655
|
};
|
|
2750
|
-
var emval_returnValue =
|
|
2656
|
+
var emval_returnValue = (returnType, destructorsRef, handle) => {
|
|
2751
2657
|
var destructors = [];
|
|
2752
2658
|
var result = returnType['toWireType'](destructors, handle);
|
|
2753
2659
|
if (destructors.length) {
|
|
@@ -2756,40 +2662,40 @@ var WebRendererWasmFactory = function () {
|
|
|
2756
2662
|
}
|
|
2757
2663
|
return result;
|
|
2758
2664
|
};
|
|
2759
|
-
var __emval_as =
|
|
2665
|
+
var __emval_as = (handle, returnType, destructorsRef) => {
|
|
2760
2666
|
handle = Emval.toValue(handle);
|
|
2761
2667
|
returnType = requireRegisteredType(returnType, 'emval::as');
|
|
2762
2668
|
return emval_returnValue(returnType, destructorsRef, handle);
|
|
2763
2669
|
};
|
|
2764
2670
|
var emval_methodCallers = [];
|
|
2765
|
-
var __emval_call =
|
|
2671
|
+
var __emval_call = (caller, handle, destructorsRef, args) => {
|
|
2766
2672
|
caller = emval_methodCallers[caller];
|
|
2767
2673
|
handle = Emval.toValue(handle);
|
|
2768
2674
|
return caller(null, handle, destructorsRef, args);
|
|
2769
2675
|
};
|
|
2770
2676
|
var emval_symbols = {};
|
|
2771
|
-
var getStringOrSymbol =
|
|
2677
|
+
var getStringOrSymbol = address => {
|
|
2772
2678
|
var symbol = emval_symbols[address];
|
|
2773
2679
|
if (symbol === undefined) {
|
|
2774
2680
|
return readLatin1String(address);
|
|
2775
2681
|
}
|
|
2776
2682
|
return symbol;
|
|
2777
2683
|
};
|
|
2778
|
-
var __emval_call_method =
|
|
2684
|
+
var __emval_call_method = (caller, objHandle, methodName, destructorsRef, args) => {
|
|
2779
2685
|
caller = emval_methodCallers[caller];
|
|
2780
2686
|
objHandle = Emval.toValue(objHandle);
|
|
2781
2687
|
methodName = getStringOrSymbol(methodName);
|
|
2782
2688
|
return caller(objHandle, objHandle[methodName], destructorsRef, args);
|
|
2783
2689
|
};
|
|
2784
|
-
var emval_get_global =
|
|
2785
|
-
if (
|
|
2690
|
+
var emval_get_global = () => {
|
|
2691
|
+
if (typeof globalThis == 'object') {
|
|
2786
2692
|
return globalThis;
|
|
2787
2693
|
}
|
|
2788
2694
|
return function () {
|
|
2789
2695
|
return Function;
|
|
2790
2696
|
}()('return this')();
|
|
2791
2697
|
};
|
|
2792
|
-
var __emval_get_global =
|
|
2698
|
+
var __emval_get_global = name => {
|
|
2793
2699
|
if (name === 0) {
|
|
2794
2700
|
return Emval.toHandle(emval_get_global());
|
|
2795
2701
|
} else {
|
|
@@ -2797,19 +2703,19 @@ var WebRendererWasmFactory = function () {
|
|
|
2797
2703
|
return Emval.toHandle(emval_get_global()[name]);
|
|
2798
2704
|
}
|
|
2799
2705
|
};
|
|
2800
|
-
var emval_addMethodCaller =
|
|
2706
|
+
var emval_addMethodCaller = caller => {
|
|
2801
2707
|
var id = emval_methodCallers.length;
|
|
2802
2708
|
emval_methodCallers.push(caller);
|
|
2803
2709
|
return id;
|
|
2804
2710
|
};
|
|
2805
|
-
var emval_lookupTypes =
|
|
2711
|
+
var emval_lookupTypes = (argCount, argTypes) => {
|
|
2806
2712
|
var a = new Array(argCount);
|
|
2807
2713
|
for (var i = 0; i < argCount; ++i) {
|
|
2808
2714
|
a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], "parameter " + i);
|
|
2809
2715
|
}
|
|
2810
2716
|
return a;
|
|
2811
2717
|
};
|
|
2812
|
-
var __emval_get_method_caller =
|
|
2718
|
+
var __emval_get_method_caller = (argCount, argTypes, kind) => {
|
|
2813
2719
|
var types = emval_lookupTypes(argCount, argTypes);
|
|
2814
2720
|
var retType = types.shift();
|
|
2815
2721
|
argCount--; // remove the shifted off return type
|
|
@@ -2838,47 +2744,39 @@ var WebRendererWasmFactory = function () {
|
|
|
2838
2744
|
}
|
|
2839
2745
|
functionBody += "};\n";
|
|
2840
2746
|
params.push(functionBody);
|
|
2841
|
-
var invokerFunction = newFunc(Function, params)
|
|
2842
|
-
var functionName = "methodCaller<(".concat(types.map(
|
|
2843
|
-
return t.name;
|
|
2844
|
-
}).join(', '), ") => ").concat(retType.name, ">");
|
|
2747
|
+
var invokerFunction = newFunc(Function, params)(...args);
|
|
2748
|
+
var functionName = "methodCaller<(".concat(types.map(t => t.name).join(', '), ") => ").concat(retType.name, ">");
|
|
2845
2749
|
return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction));
|
|
2846
2750
|
};
|
|
2847
|
-
var __emval_get_module_property =
|
|
2751
|
+
var __emval_get_module_property = name => {
|
|
2848
2752
|
name = getStringOrSymbol(name);
|
|
2849
2753
|
return Emval.toHandle(Module[name]);
|
|
2850
2754
|
};
|
|
2851
|
-
var __emval_get_property =
|
|
2755
|
+
var __emval_get_property = (handle, key) => {
|
|
2852
2756
|
handle = Emval.toValue(handle);
|
|
2853
2757
|
key = Emval.toValue(key);
|
|
2854
2758
|
return Emval.toHandle(handle[key]);
|
|
2855
2759
|
};
|
|
2856
|
-
var __emval_incref =
|
|
2760
|
+
var __emval_incref = handle => {
|
|
2857
2761
|
if (handle > 9) {
|
|
2858
2762
|
emval_handles[handle + 1] += 1;
|
|
2859
2763
|
}
|
|
2860
2764
|
};
|
|
2861
|
-
var __emval_new_array =
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
var __emval_new_cstring = function __emval_new_cstring(v) {
|
|
2865
|
-
return Emval.toHandle(getStringOrSymbol(v));
|
|
2866
|
-
};
|
|
2867
|
-
var __emval_run_destructors = function __emval_run_destructors(handle) {
|
|
2765
|
+
var __emval_new_array = () => Emval.toHandle([]);
|
|
2766
|
+
var __emval_new_cstring = v => Emval.toHandle(getStringOrSymbol(v));
|
|
2767
|
+
var __emval_run_destructors = handle => {
|
|
2868
2768
|
var destructors = Emval.toValue(handle);
|
|
2869
2769
|
runDestructors(destructors);
|
|
2870
2770
|
__emval_decref(handle);
|
|
2871
2771
|
};
|
|
2872
|
-
var __emval_take_value =
|
|
2772
|
+
var __emval_take_value = (type, arg) => {
|
|
2873
2773
|
type = requireRegisteredType(type, '_emval_take_value');
|
|
2874
2774
|
var v = type['readValueFromPointer'](arg);
|
|
2875
2775
|
return Emval.toHandle(v);
|
|
2876
2776
|
};
|
|
2877
2777
|
var MAX_INT53 = 9007199254740992;
|
|
2878
2778
|
var MIN_INT53 = -9007199254740992;
|
|
2879
|
-
var bigintToI53Checked =
|
|
2880
|
-
return num < MIN_INT53 || num > MAX_INT53 ? NaN : Number(num);
|
|
2881
|
-
};
|
|
2779
|
+
var bigintToI53Checked = num => num < MIN_INT53 || num > MAX_INT53 ? NaN : Number(num);
|
|
2882
2780
|
function __gmtime_js(time, tmPtr) {
|
|
2883
2781
|
time = bigintToI53Checked(time);
|
|
2884
2782
|
var date = new Date(time * 1000);
|
|
@@ -2893,7 +2791,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2893
2791
|
var yday = (date.getTime() - start) / (1000 * 60 * 60 * 24) | 0;
|
|
2894
2792
|
HEAP32[tmPtr + 28 >> 2] = yday;
|
|
2895
2793
|
}
|
|
2896
|
-
var __tzset_js =
|
|
2794
|
+
var __tzset_js = (timezone, daylight, std_name, dst_name) => {
|
|
2897
2795
|
// TODO: Use (malleable) environment variables instead of system settings.
|
|
2898
2796
|
var currentYear = new Date().getFullYear();
|
|
2899
2797
|
var winter = new Date(currentYear, 0, 1);
|
|
@@ -2916,12 +2814,10 @@ var WebRendererWasmFactory = function () {
|
|
|
2916
2814
|
// See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html
|
|
2917
2815
|
HEAPU32[timezone >> 2] = stdTimezoneOffset * 60;
|
|
2918
2816
|
HEAP32[daylight >> 2] = Number(winterOffset != summerOffset);
|
|
2919
|
-
var extractZone =
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
}).split(' ')[1];
|
|
2924
|
-
};
|
|
2817
|
+
var extractZone = date => date.toLocaleTimeString(undefined, {
|
|
2818
|
+
hour12: false,
|
|
2819
|
+
timeZoneName: 'short'
|
|
2820
|
+
}).split(' ')[1];
|
|
2925
2821
|
var winterName = extractZone(winter);
|
|
2926
2822
|
var summerName = extractZone(summer);
|
|
2927
2823
|
assert(winterName);
|
|
@@ -2937,34 +2833,21 @@ var WebRendererWasmFactory = function () {
|
|
|
2937
2833
|
stringToUTF8(summerName, std_name, 17);
|
|
2938
2834
|
}
|
|
2939
2835
|
};
|
|
2940
|
-
var _emscripten_cancel_animation_frame =
|
|
2941
|
-
|
|
2942
|
-
};
|
|
2943
|
-
var _emscripten_date_now = function _emscripten_date_now() {
|
|
2944
|
-
return Date.now();
|
|
2945
|
-
};
|
|
2836
|
+
var _emscripten_cancel_animation_frame = id => cancelAnimationFrame(id);
|
|
2837
|
+
var _emscripten_date_now = () => Date.now();
|
|
2946
2838
|
var _emscripten_get_now;
|
|
2947
2839
|
// Modern environment where performance.now() is supported:
|
|
2948
2840
|
// N.B. a shorter form "_emscripten_get_now = performance.now;" is
|
|
2949
2841
|
// unfortunately not allowed even in current browsers (e.g. FF Nightly 75).
|
|
2950
|
-
_emscripten_get_now =
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
var
|
|
2959
|
-
return (
|
|
2960
|
-
// Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
|
|
2961
|
-
// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
|
|
2962
|
-
// for any code that deals with heap sizes, which would require special
|
|
2963
|
-
// casing all heap size related code to treat 0 specially.
|
|
2964
|
-
2147483648
|
|
2965
|
-
);
|
|
2966
|
-
};
|
|
2967
|
-
var growMemory = function growMemory(size) {
|
|
2842
|
+
_emscripten_get_now = () => performance.now();
|
|
2843
|
+
var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame(timeStamp => getWasmTableEntry(cb)(timeStamp, userData));
|
|
2844
|
+
var getHeapMax = () =>
|
|
2845
|
+
// Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
|
|
2846
|
+
// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
|
|
2847
|
+
// for any code that deals with heap sizes, which would require special
|
|
2848
|
+
// casing all heap size related code to treat 0 specially.
|
|
2849
|
+
2147483648;
|
|
2850
|
+
var growMemory = size => {
|
|
2968
2851
|
var b = wasmMemory.buffer;
|
|
2969
2852
|
var pages = (size - b.byteLength + 65535) / 65536;
|
|
2970
2853
|
try {
|
|
@@ -2978,7 +2861,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2978
2861
|
// implicit 0 return to save code size (caller will cast "undefined" into 0
|
|
2979
2862
|
// anyhow)
|
|
2980
2863
|
};
|
|
2981
|
-
var _emscripten_resize_heap =
|
|
2864
|
+
var _emscripten_resize_heap = requestedSize => {
|
|
2982
2865
|
var oldSize = HEAPU8.length;
|
|
2983
2866
|
// With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
|
|
2984
2867
|
requestedSize >>>= 0;
|
|
@@ -3010,9 +2893,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3010
2893
|
err("Cannot enlarge memory, requested ".concat(requestedSize, " bytes, but the limit is ").concat(maxHeapSize, " bytes!"));
|
|
3011
2894
|
return false;
|
|
3012
2895
|
}
|
|
3013
|
-
var alignUp =
|
|
3014
|
-
return x + (multiple - x % multiple) % multiple;
|
|
3015
|
-
};
|
|
2896
|
+
var alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
|
|
3016
2897
|
|
|
3017
2898
|
// Loop through potential heap size increases. If we attempt a too eager
|
|
3018
2899
|
// reservation that fails, cut down on the attempted size and reserve a
|
|
@@ -3030,66 +2911,47 @@ var WebRendererWasmFactory = function () {
|
|
|
3030
2911
|
err("Failed to grow the heap from ".concat(oldSize, " bytes to ").concat(newSize, " bytes, not enough memory!"));
|
|
3031
2912
|
return false;
|
|
3032
2913
|
};
|
|
3033
|
-
var webgl_enable_ANGLE_instanced_arrays =
|
|
2914
|
+
var webgl_enable_ANGLE_instanced_arrays = ctx => {
|
|
3034
2915
|
// Extension available in WebGL 1 from Firefox 26 and Google Chrome 30 onwards. Core feature in WebGL 2.
|
|
3035
2916
|
var ext = ctx.getExtension('ANGLE_instanced_arrays');
|
|
3036
2917
|
if (ext) {
|
|
3037
|
-
ctx['vertexAttribDivisor'] =
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
ctx['drawArraysInstanced'] = function (mode, first, count, primcount) {
|
|
3041
|
-
return ext['drawArraysInstancedANGLE'](mode, first, count, primcount);
|
|
3042
|
-
};
|
|
3043
|
-
ctx['drawElementsInstanced'] = function (mode, count, type, indices, primcount) {
|
|
3044
|
-
return ext['drawElementsInstancedANGLE'](mode, count, type, indices, primcount);
|
|
3045
|
-
};
|
|
2918
|
+
ctx['vertexAttribDivisor'] = (index, divisor) => ext['vertexAttribDivisorANGLE'](index, divisor);
|
|
2919
|
+
ctx['drawArraysInstanced'] = (mode, first, count, primcount) => ext['drawArraysInstancedANGLE'](mode, first, count, primcount);
|
|
2920
|
+
ctx['drawElementsInstanced'] = (mode, count, type, indices, primcount) => ext['drawElementsInstancedANGLE'](mode, count, type, indices, primcount);
|
|
3046
2921
|
return 1;
|
|
3047
2922
|
}
|
|
3048
2923
|
};
|
|
3049
|
-
var webgl_enable_OES_vertex_array_object =
|
|
2924
|
+
var webgl_enable_OES_vertex_array_object = ctx => {
|
|
3050
2925
|
// Extension available in WebGL 1 from Firefox 25 and WebKit 536.28/desktop Safari 6.0.3 onwards. Core feature in WebGL 2.
|
|
3051
2926
|
var ext = ctx.getExtension('OES_vertex_array_object');
|
|
3052
2927
|
if (ext) {
|
|
3053
|
-
ctx['createVertexArray'] =
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
ctx['
|
|
3057
|
-
return ext['deleteVertexArrayOES'](vao);
|
|
3058
|
-
};
|
|
3059
|
-
ctx['bindVertexArray'] = function (vao) {
|
|
3060
|
-
return ext['bindVertexArrayOES'](vao);
|
|
3061
|
-
};
|
|
3062
|
-
ctx['isVertexArray'] = function (vao) {
|
|
3063
|
-
return ext['isVertexArrayOES'](vao);
|
|
3064
|
-
};
|
|
2928
|
+
ctx['createVertexArray'] = () => ext['createVertexArrayOES']();
|
|
2929
|
+
ctx['deleteVertexArray'] = vao => ext['deleteVertexArrayOES'](vao);
|
|
2930
|
+
ctx['bindVertexArray'] = vao => ext['bindVertexArrayOES'](vao);
|
|
2931
|
+
ctx['isVertexArray'] = vao => ext['isVertexArrayOES'](vao);
|
|
3065
2932
|
return 1;
|
|
3066
2933
|
}
|
|
3067
2934
|
};
|
|
3068
|
-
var webgl_enable_WEBGL_draw_buffers =
|
|
2935
|
+
var webgl_enable_WEBGL_draw_buffers = ctx => {
|
|
3069
2936
|
// Extension available in WebGL 1 from Firefox 28 onwards. Core feature in WebGL 2.
|
|
3070
2937
|
var ext = ctx.getExtension('WEBGL_draw_buffers');
|
|
3071
2938
|
if (ext) {
|
|
3072
|
-
ctx['drawBuffers'] =
|
|
3073
|
-
return ext['drawBuffersWEBGL'](n, bufs);
|
|
3074
|
-
};
|
|
2939
|
+
ctx['drawBuffers'] = (n, bufs) => ext['drawBuffersWEBGL'](n, bufs);
|
|
3075
2940
|
return 1;
|
|
3076
2941
|
}
|
|
3077
2942
|
};
|
|
3078
|
-
var webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance =
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
);
|
|
3083
|
-
};
|
|
3084
|
-
var webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance = function webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance(ctx) {
|
|
2943
|
+
var webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance = ctx =>
|
|
2944
|
+
// Closure is expected to be allowed to minify the '.dibvbi' property, so not accessing it quoted.
|
|
2945
|
+
!!(ctx.dibvbi = ctx.getExtension('WEBGL_draw_instanced_base_vertex_base_instance'));
|
|
2946
|
+
var webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance = ctx => {
|
|
3085
2947
|
// Closure is expected to be allowed to minify the '.mdibvbi' property, so not accessing it quoted.
|
|
3086
2948
|
return !!(ctx.mdibvbi = ctx.getExtension('WEBGL_multi_draw_instanced_base_vertex_base_instance'));
|
|
3087
2949
|
};
|
|
3088
|
-
var webgl_enable_WEBGL_multi_draw =
|
|
2950
|
+
var webgl_enable_WEBGL_multi_draw = ctx => {
|
|
3089
2951
|
// Closure is expected to be allowed to minify the '.multiDrawWebgl' property, so not accessing it quoted.
|
|
3090
2952
|
return !!(ctx.multiDrawWebgl = ctx.getExtension('WEBGL_multi_draw'));
|
|
3091
2953
|
};
|
|
3092
|
-
var getEmscriptenSupportedExtensions =
|
|
2954
|
+
var getEmscriptenSupportedExtensions = ctx => {
|
|
3093
2955
|
// Restrict the list of advertised extensions to those that we actually
|
|
3094
2956
|
// support.
|
|
3095
2957
|
var supportedExtensions = [
|
|
@@ -3100,9 +2962,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3100
2962
|
// WebGL 1 and WebGL 2 extensions
|
|
3101
2963
|
'EXT_color_buffer_half_float', 'EXT_depth_clamp', 'EXT_float_blend', 'EXT_texture_compression_bptc', 'EXT_texture_compression_rgtc', 'EXT_texture_filter_anisotropic', 'KHR_parallel_shader_compile', 'OES_texture_float_linear', 'WEBGL_blend_func_extended', 'WEBGL_compressed_texture_astc', 'WEBGL_compressed_texture_etc', 'WEBGL_compressed_texture_etc1', 'WEBGL_compressed_texture_s3tc', 'WEBGL_compressed_texture_s3tc_srgb', 'WEBGL_debug_renderer_info', 'WEBGL_debug_shaders', 'WEBGL_lose_context', 'WEBGL_multi_draw'];
|
|
3102
2964
|
// .getSupportedExtensions() can return null if context is lost, so coerce to empty array.
|
|
3103
|
-
return (ctx.getSupportedExtensions() || []).filter(
|
|
3104
|
-
return supportedExtensions.includes(ext);
|
|
3105
|
-
});
|
|
2965
|
+
return (ctx.getSupportedExtensions() || []).filter(ext => supportedExtensions.includes(ext));
|
|
3106
2966
|
};
|
|
3107
2967
|
var GL = {
|
|
3108
2968
|
counter: 1,
|
|
@@ -3122,19 +2982,19 @@ var WebRendererWasmFactory = function () {
|
|
|
3122
2982
|
stringCache: {},
|
|
3123
2983
|
stringiCache: {},
|
|
3124
2984
|
unpackAlignment: 4,
|
|
3125
|
-
recordError:
|
|
2985
|
+
recordError: errorCode => {
|
|
3126
2986
|
if (!GL.lastError) {
|
|
3127
2987
|
GL.lastError = errorCode;
|
|
3128
2988
|
}
|
|
3129
2989
|
},
|
|
3130
|
-
getNewId:
|
|
2990
|
+
getNewId: table => {
|
|
3131
2991
|
var ret = GL.counter++;
|
|
3132
2992
|
for (var i = table.length; i < ret; i++) {
|
|
3133
2993
|
table[i] = null;
|
|
3134
2994
|
}
|
|
3135
2995
|
return ret;
|
|
3136
2996
|
},
|
|
3137
|
-
genObject:
|
|
2997
|
+
genObject: (n, buffers, createFunction, objectTable) => {
|
|
3138
2998
|
for (var i = 0; i < n; i++) {
|
|
3139
2999
|
var buffer = GLctx[createFunction]();
|
|
3140
3000
|
var id = buffer && GL.getNewId(objectTable);
|
|
@@ -3147,7 +3007,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3147
3007
|
HEAP32[buffers + i * 4 >> 2] = id;
|
|
3148
3008
|
}
|
|
3149
3009
|
},
|
|
3150
|
-
getSource:
|
|
3010
|
+
getSource: (shader, count, string, length) => {
|
|
3151
3011
|
var source = '';
|
|
3152
3012
|
for (var i = 0; i < count; ++i) {
|
|
3153
3013
|
var len = length ? HEAPU32[length + i * 4 >> 2] : undefined;
|
|
@@ -3155,7 +3015,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3155
3015
|
}
|
|
3156
3016
|
return source;
|
|
3157
3017
|
},
|
|
3158
|
-
createContext:
|
|
3018
|
+
createContext: ( /** @type {HTMLCanvasElement} */canvas, webGLContextAttributes) => {
|
|
3159
3019
|
// BUG: Workaround Safari WebGL issue: After successfully acquiring WebGL
|
|
3160
3020
|
// context on a canvas, calling .getContext() will always return that
|
|
3161
3021
|
// context independent of which 'webgl' or 'webgl2'
|
|
@@ -3166,12 +3026,12 @@ var WebRendererWasmFactory = function () {
|
|
|
3166
3026
|
// TODO: Once the bug is fixed and shipped in Safari, adjust the Safari
|
|
3167
3027
|
// version field in above check.
|
|
3168
3028
|
if (!canvas.getContextSafariWebGL2Fixed) {
|
|
3029
|
+
canvas.getContextSafariWebGL2Fixed = canvas.getContext;
|
|
3169
3030
|
/** @type {function(this:HTMLCanvasElement, string, (Object|null)=): (Object|null)} */
|
|
3170
|
-
|
|
3031
|
+
function fixedGetContext(ver, attrs) {
|
|
3171
3032
|
var gl = canvas.getContextSafariWebGL2Fixed(ver, attrs);
|
|
3172
3033
|
return ver == 'webgl' == gl instanceof WebGLRenderingContext ? gl : null;
|
|
3173
|
-
}
|
|
3174
|
-
canvas.getContextSafariWebGL2Fixed = canvas.getContext;
|
|
3034
|
+
}
|
|
3175
3035
|
canvas.getContext = fixedGetContext;
|
|
3176
3036
|
}
|
|
3177
3037
|
var ctx = webGLContextAttributes.majorVersion > 1 ? canvas.getContext("webgl2", webGLContextAttributes) : canvas.getContext("webgl", webGLContextAttributes)
|
|
@@ -3181,11 +3041,11 @@ var WebRendererWasmFactory = function () {
|
|
|
3181
3041
|
var handle = GL.registerContext(ctx, webGLContextAttributes);
|
|
3182
3042
|
return handle;
|
|
3183
3043
|
},
|
|
3184
|
-
registerContext:
|
|
3044
|
+
registerContext: (ctx, webGLContextAttributes) => {
|
|
3185
3045
|
// without pthreads a context is just an integer ID
|
|
3186
3046
|
var handle = GL.getNewId(GL.contexts);
|
|
3187
3047
|
var context = {
|
|
3188
|
-
handle
|
|
3048
|
+
handle,
|
|
3189
3049
|
attributes: webGLContextAttributes,
|
|
3190
3050
|
version: webGLContextAttributes.majorVersion,
|
|
3191
3051
|
GLctx: ctx
|
|
@@ -3200,7 +3060,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3200
3060
|
}
|
|
3201
3061
|
return handle;
|
|
3202
3062
|
},
|
|
3203
|
-
makeContextCurrent:
|
|
3063
|
+
makeContextCurrent: contextHandle => {
|
|
3204
3064
|
var _GL$currentContext;
|
|
3205
3065
|
// Active Emscripten GL layer context object.
|
|
3206
3066
|
GL.currentContext = GL.contexts[contextHandle];
|
|
@@ -3208,14 +3068,14 @@ var WebRendererWasmFactory = function () {
|
|
|
3208
3068
|
Module.ctx = GLctx = (_GL$currentContext = GL.currentContext) === null || _GL$currentContext === void 0 ? void 0 : _GL$currentContext.GLctx;
|
|
3209
3069
|
return !(contextHandle && !GLctx);
|
|
3210
3070
|
},
|
|
3211
|
-
getContext:
|
|
3071
|
+
getContext: contextHandle => {
|
|
3212
3072
|
return GL.contexts[contextHandle];
|
|
3213
3073
|
},
|
|
3214
|
-
deleteContext:
|
|
3074
|
+
deleteContext: contextHandle => {
|
|
3215
3075
|
if (GL.currentContext === GL.contexts[contextHandle]) {
|
|
3216
3076
|
GL.currentContext = null;
|
|
3217
3077
|
}
|
|
3218
|
-
if (
|
|
3078
|
+
if (typeof JSEvents == 'object') {
|
|
3219
3079
|
// Release all JS event handlers on the DOM element that the GL context is
|
|
3220
3080
|
// associated with since the context is now deleted.
|
|
3221
3081
|
JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);
|
|
@@ -3227,7 +3087,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3227
3087
|
}
|
|
3228
3088
|
GL.contexts[contextHandle] = null;
|
|
3229
3089
|
},
|
|
3230
|
-
initExtensions:
|
|
3090
|
+
initExtensions: context => {
|
|
3231
3091
|
// If this function is called without a specific context object, init the
|
|
3232
3092
|
// extensions of the currently active context.
|
|
3233
3093
|
context || (context = GL.currentContext);
|
|
@@ -3261,7 +3121,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3261
3121
|
GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");
|
|
3262
3122
|
}
|
|
3263
3123
|
webgl_enable_WEBGL_multi_draw(GLctx);
|
|
3264
|
-
getEmscriptenSupportedExtensions(GLctx).forEach(
|
|
3124
|
+
getEmscriptenSupportedExtensions(GLctx).forEach(ext => {
|
|
3265
3125
|
// WEBGL_lose_context, WEBGL_debug_renderer_info and WEBGL_debug_shaders
|
|
3266
3126
|
// are not enabled by default.
|
|
3267
3127
|
if (!ext.includes('lose_context') && !ext.includes('debug')) {
|
|
@@ -3271,19 +3131,19 @@ var WebRendererWasmFactory = function () {
|
|
|
3271
3131
|
});
|
|
3272
3132
|
}
|
|
3273
3133
|
};
|
|
3274
|
-
var _emscripten_webgl_make_context_current =
|
|
3134
|
+
var _emscripten_webgl_make_context_current = contextHandle => {
|
|
3275
3135
|
var success = GL.makeContextCurrent(contextHandle);
|
|
3276
3136
|
return success ? 0 : -5;
|
|
3277
3137
|
};
|
|
3278
3138
|
var ENV = {};
|
|
3279
|
-
var getExecutableName =
|
|
3139
|
+
var getExecutableName = () => {
|
|
3280
3140
|
return thisProgram ;
|
|
3281
3141
|
};
|
|
3282
|
-
var
|
|
3283
|
-
if (!
|
|
3142
|
+
var getEnvStrings = () => {
|
|
3143
|
+
if (!getEnvStrings.strings) {
|
|
3284
3144
|
// Default values.
|
|
3285
3145
|
// Browser language detection #8751
|
|
3286
|
-
var lang = (
|
|
3146
|
+
var lang = (typeof navigator == 'object' && navigator.languages && navigator.languages[0] || 'C').replace('-', '_') + '.UTF-8';
|
|
3287
3147
|
var env = {
|
|
3288
3148
|
'USER': 'web_user',
|
|
3289
3149
|
'LOGNAME': 'web_user',
|
|
@@ -3304,11 +3164,11 @@ var WebRendererWasmFactory = function () {
|
|
|
3304
3164
|
for (var x in env) {
|
|
3305
3165
|
strings.push("".concat(x, "=").concat(env[x]));
|
|
3306
3166
|
}
|
|
3307
|
-
|
|
3167
|
+
getEnvStrings.strings = strings;
|
|
3308
3168
|
}
|
|
3309
|
-
return
|
|
3169
|
+
return getEnvStrings.strings;
|
|
3310
3170
|
};
|
|
3311
|
-
var stringToAscii =
|
|
3171
|
+
var stringToAscii = (str, buffer) => {
|
|
3312
3172
|
for (var i = 0; i < str.length; ++i) {
|
|
3313
3173
|
assert(str.charCodeAt(i) === (str.charCodeAt(i) & 0xff));
|
|
3314
3174
|
HEAP8[buffer++] = str.charCodeAt(i);
|
|
@@ -3316,9 +3176,9 @@ var WebRendererWasmFactory = function () {
|
|
|
3316
3176
|
// Null-terminate the string
|
|
3317
3177
|
HEAP8[buffer] = 0;
|
|
3318
3178
|
};
|
|
3319
|
-
var _environ_get =
|
|
3179
|
+
var _environ_get = (__environ, environ_buf) => {
|
|
3320
3180
|
var bufSize = 0;
|
|
3321
|
-
|
|
3181
|
+
getEnvStrings().forEach((string, i) => {
|
|
3322
3182
|
var ptr = environ_buf + bufSize;
|
|
3323
3183
|
HEAPU32[__environ + i * 4 >> 2] = ptr;
|
|
3324
3184
|
stringToAscii(string, ptr);
|
|
@@ -3326,21 +3186,17 @@ var WebRendererWasmFactory = function () {
|
|
|
3326
3186
|
});
|
|
3327
3187
|
return 0;
|
|
3328
3188
|
};
|
|
3329
|
-
var _environ_sizes_get =
|
|
3330
|
-
var strings =
|
|
3189
|
+
var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
|
|
3190
|
+
var strings = getEnvStrings();
|
|
3331
3191
|
HEAPU32[penviron_count >> 2] = strings.length;
|
|
3332
3192
|
var bufSize = 0;
|
|
3333
|
-
strings.forEach(
|
|
3334
|
-
return bufSize += string.length + 1;
|
|
3335
|
-
});
|
|
3193
|
+
strings.forEach(string => bufSize += string.length + 1);
|
|
3336
3194
|
HEAPU32[penviron_buf_size >> 2] = bufSize;
|
|
3337
3195
|
return 0;
|
|
3338
3196
|
};
|
|
3339
3197
|
var runtimeKeepaliveCounter = 0;
|
|
3340
|
-
var keepRuntimeAlive =
|
|
3341
|
-
|
|
3342
|
-
};
|
|
3343
|
-
var _proc_exit = function _proc_exit(code) {
|
|
3198
|
+
var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;
|
|
3199
|
+
var _proc_exit = code => {
|
|
3344
3200
|
if (!keepRuntimeAlive()) {
|
|
3345
3201
|
ABORT = true;
|
|
3346
3202
|
}
|
|
@@ -3349,7 +3205,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3349
3205
|
|
|
3350
3206
|
/** @suppress {duplicate } */
|
|
3351
3207
|
/** @param {boolean|number=} implicit */
|
|
3352
|
-
var exitJS =
|
|
3208
|
+
var exitJS = (status, implicit) => {
|
|
3353
3209
|
checkUnflushedContent();
|
|
3354
3210
|
|
|
3355
3211
|
// if exit() was called explicitly, warn the user if the runtime isn't actually being shut down
|
|
@@ -3361,14 +3217,14 @@ var WebRendererWasmFactory = function () {
|
|
|
3361
3217
|
_proc_exit(status);
|
|
3362
3218
|
};
|
|
3363
3219
|
var _exit = exitJS;
|
|
3364
|
-
var _fd_close =
|
|
3220
|
+
var _fd_close = fd => {
|
|
3365
3221
|
abort('fd_close called without SYSCALLS_REQUIRE_FILESYSTEM');
|
|
3366
3222
|
};
|
|
3367
3223
|
function _fd_seek(fd, offset, whence, newOffset) {
|
|
3368
3224
|
return 70;
|
|
3369
3225
|
}
|
|
3370
3226
|
var printCharBuffers = [null, [], []];
|
|
3371
|
-
var printChar =
|
|
3227
|
+
var printChar = (stream, curr) => {
|
|
3372
3228
|
var buffer = printCharBuffers[stream];
|
|
3373
3229
|
assert(buffer);
|
|
3374
3230
|
if (curr === 0 || curr === 10) {
|
|
@@ -3378,13 +3234,13 @@ var WebRendererWasmFactory = function () {
|
|
|
3378
3234
|
buffer.push(curr);
|
|
3379
3235
|
}
|
|
3380
3236
|
};
|
|
3381
|
-
var flush_NO_FILESYSTEM =
|
|
3237
|
+
var flush_NO_FILESYSTEM = () => {
|
|
3382
3238
|
// flush anything remaining in the buffers during shutdown
|
|
3383
3239
|
_fflush(0);
|
|
3384
3240
|
if (printCharBuffers[1].length) printChar(1, 10);
|
|
3385
3241
|
if (printCharBuffers[2].length) printChar(2, 10);
|
|
3386
3242
|
};
|
|
3387
|
-
var _fd_write =
|
|
3243
|
+
var _fd_write = (fd, iov, iovcnt, pnum) => {
|
|
3388
3244
|
// hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
|
|
3389
3245
|
var num = 0;
|
|
3390
3246
|
for (var i = 0; i < iovcnt; i++) {
|
|
@@ -3399,16 +3255,14 @@ var WebRendererWasmFactory = function () {
|
|
|
3399
3255
|
HEAPU32[pnum >> 2] = num;
|
|
3400
3256
|
return 0;
|
|
3401
3257
|
};
|
|
3402
|
-
var _glActiveTexture =
|
|
3403
|
-
|
|
3404
|
-
};
|
|
3405
|
-
var _glAttachShader = function _glAttachShader(program, shader) {
|
|
3258
|
+
var _glActiveTexture = x0 => GLctx.activeTexture(x0);
|
|
3259
|
+
var _glAttachShader = (program, shader) => {
|
|
3406
3260
|
GLctx.attachShader(GL.programs[program], GL.shaders[shader]);
|
|
3407
3261
|
};
|
|
3408
|
-
var _glBindAttribLocation =
|
|
3262
|
+
var _glBindAttribLocation = (program, index, name) => {
|
|
3409
3263
|
GLctx.bindAttribLocation(GL.programs[program], index, UTF8ToString(name));
|
|
3410
3264
|
};
|
|
3411
|
-
var _glBindBuffer =
|
|
3265
|
+
var _glBindBuffer = (target, buffer) => {
|
|
3412
3266
|
if (target == 0x88EB /*GL_PIXEL_PACK_BUFFER*/) {
|
|
3413
3267
|
// In WebGL 2 glReadPixels entry point, we need to use a different WebGL 2
|
|
3414
3268
|
// API function call when a buffer is bound to
|
|
@@ -3426,35 +3280,27 @@ var WebRendererWasmFactory = function () {
|
|
|
3426
3280
|
}
|
|
3427
3281
|
GLctx.bindBuffer(target, GL.buffers[buffer]);
|
|
3428
3282
|
};
|
|
3429
|
-
var _glBindFramebuffer =
|
|
3283
|
+
var _glBindFramebuffer = (target, framebuffer) => {
|
|
3430
3284
|
GLctx.bindFramebuffer(target, GL.framebuffers[framebuffer]);
|
|
3431
3285
|
};
|
|
3432
|
-
var _glBindRenderbuffer =
|
|
3286
|
+
var _glBindRenderbuffer = (target, renderbuffer) => {
|
|
3433
3287
|
GLctx.bindRenderbuffer(target, GL.renderbuffers[renderbuffer]);
|
|
3434
3288
|
};
|
|
3435
|
-
var _glBindSampler =
|
|
3289
|
+
var _glBindSampler = (unit, sampler) => {
|
|
3436
3290
|
GLctx.bindSampler(unit, GL.samplers[sampler]);
|
|
3437
3291
|
};
|
|
3438
|
-
var _glBindTexture =
|
|
3292
|
+
var _glBindTexture = (target, texture) => {
|
|
3439
3293
|
GLctx.bindTexture(target, GL.textures[texture]);
|
|
3440
3294
|
};
|
|
3441
|
-
var _glBindVertexArray =
|
|
3295
|
+
var _glBindVertexArray = vao => {
|
|
3442
3296
|
GLctx.bindVertexArray(GL.vaos[vao]);
|
|
3443
3297
|
};
|
|
3444
3298
|
var _glBindVertexArrayOES = _glBindVertexArray;
|
|
3445
|
-
var _glBlendColor =
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
var
|
|
3449
|
-
|
|
3450
|
-
};
|
|
3451
|
-
var _glBlendFunc = function _glBlendFunc(x0, x1) {
|
|
3452
|
-
return GLctx.blendFunc(x0, x1);
|
|
3453
|
-
};
|
|
3454
|
-
var _glBlitFramebuffer = function _glBlitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) {
|
|
3455
|
-
return GLctx.blitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
|
|
3456
|
-
};
|
|
3457
|
-
var _glBufferData = function _glBufferData(target, size, data, usage) {
|
|
3299
|
+
var _glBlendColor = (x0, x1, x2, x3) => GLctx.blendColor(x0, x1, x2, x3);
|
|
3300
|
+
var _glBlendEquation = x0 => GLctx.blendEquation(x0);
|
|
3301
|
+
var _glBlendFunc = (x0, x1) => GLctx.blendFunc(x0, x1);
|
|
3302
|
+
var _glBlitFramebuffer = (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) => GLctx.blitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
|
|
3303
|
+
var _glBufferData = (target, size, data, usage) => {
|
|
3458
3304
|
if (GL.currentContext.version >= 2) {
|
|
3459
3305
|
// If size is zero, WebGL would interpret uploading the whole input
|
|
3460
3306
|
// arraybuffer (starting from given offset), which would not make sense in
|
|
@@ -3473,26 +3319,18 @@ var WebRendererWasmFactory = function () {
|
|
|
3473
3319
|
// engine JIT issues.
|
|
3474
3320
|
GLctx.bufferData(target, data ? HEAPU8.subarray(data, data + size) : size, usage);
|
|
3475
3321
|
};
|
|
3476
|
-
var _glBufferSubData =
|
|
3322
|
+
var _glBufferSubData = (target, offset, size, data) => {
|
|
3477
3323
|
if (GL.currentContext.version >= 2) {
|
|
3478
3324
|
size && GLctx.bufferSubData(target, offset, HEAPU8, data, size);
|
|
3479
3325
|
return;
|
|
3480
3326
|
}
|
|
3481
3327
|
GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data + size));
|
|
3482
3328
|
};
|
|
3483
|
-
var _glCheckFramebufferStatus =
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
var
|
|
3487
|
-
|
|
3488
|
-
};
|
|
3489
|
-
var _glClearColor = function _glClearColor(x0, x1, x2, x3) {
|
|
3490
|
-
return GLctx.clearColor(x0, x1, x2, x3);
|
|
3491
|
-
};
|
|
3492
|
-
var _glClearStencil = function _glClearStencil(x0) {
|
|
3493
|
-
return GLctx.clearStencil(x0);
|
|
3494
|
-
};
|
|
3495
|
-
var _glClientWaitSync = function _glClientWaitSync(sync, flags, timeout) {
|
|
3329
|
+
var _glCheckFramebufferStatus = x0 => GLctx.checkFramebufferStatus(x0);
|
|
3330
|
+
var _glClear = x0 => GLctx.clear(x0);
|
|
3331
|
+
var _glClearColor = (x0, x1, x2, x3) => GLctx.clearColor(x0, x1, x2, x3);
|
|
3332
|
+
var _glClearStencil = x0 => GLctx.clearStencil(x0);
|
|
3333
|
+
var _glClientWaitSync = (sync, flags, timeout) => {
|
|
3496
3334
|
// WebGL2 vs GLES3 differences: in GLES3, the timeout parameter is a uint64, where 0xFFFFFFFFFFFFFFFFULL means GL_TIMEOUT_IGNORED.
|
|
3497
3335
|
// In JS, there's no 64-bit value types, so instead timeout is taken to be signed, and GL_TIMEOUT_IGNORED is given value -1.
|
|
3498
3336
|
// Inherently the value accepted in the timeout is lossy, and can't take in arbitrary u64 bit pattern (but most likely doesn't matter)
|
|
@@ -3500,13 +3338,13 @@ var WebRendererWasmFactory = function () {
|
|
|
3500
3338
|
timeout = Number(timeout);
|
|
3501
3339
|
return GLctx.clientWaitSync(GL.syncs[sync], flags, timeout);
|
|
3502
3340
|
};
|
|
3503
|
-
var _glColorMask =
|
|
3341
|
+
var _glColorMask = (red, green, blue, alpha) => {
|
|
3504
3342
|
GLctx.colorMask(!!red, !!green, !!blue, !!alpha);
|
|
3505
3343
|
};
|
|
3506
|
-
var _glCompileShader =
|
|
3344
|
+
var _glCompileShader = shader => {
|
|
3507
3345
|
GLctx.compileShader(GL.shaders[shader]);
|
|
3508
3346
|
};
|
|
3509
|
-
var _glCompressedTexImage2D =
|
|
3347
|
+
var _glCompressedTexImage2D = (target, level, internalFormat, width, height, border, imageSize, data) => {
|
|
3510
3348
|
if (GL.currentContext.version >= 2) {
|
|
3511
3349
|
if (GLctx.currentPixelUnpackBufferBinding || !imageSize) {
|
|
3512
3350
|
GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data);
|
|
@@ -3517,7 +3355,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3517
3355
|
}
|
|
3518
3356
|
GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, data ? HEAPU8.subarray(data, data + imageSize) : null);
|
|
3519
3357
|
};
|
|
3520
|
-
var _glCompressedTexSubImage2D =
|
|
3358
|
+
var _glCompressedTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, imageSize, data) => {
|
|
3521
3359
|
if (GL.currentContext.version >= 2) {
|
|
3522
3360
|
if (GLctx.currentPixelUnpackBufferBinding || !imageSize) {
|
|
3523
3361
|
GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
|
|
@@ -3528,13 +3366,9 @@ var WebRendererWasmFactory = function () {
|
|
|
3528
3366
|
}
|
|
3529
3367
|
GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray(data, data + imageSize) : null);
|
|
3530
3368
|
};
|
|
3531
|
-
var _glCopyBufferSubData =
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
var _glCopyTexSubImage2D = function _glCopyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7) {
|
|
3535
|
-
return GLctx.copyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7);
|
|
3536
|
-
};
|
|
3537
|
-
var _glCreateProgram = function _glCreateProgram() {
|
|
3369
|
+
var _glCopyBufferSubData = (x0, x1, x2, x3, x4) => GLctx.copyBufferSubData(x0, x1, x2, x3, x4);
|
|
3370
|
+
var _glCopyTexSubImage2D = (x0, x1, x2, x3, x4, x5, x6, x7) => GLctx.copyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7);
|
|
3371
|
+
var _glCreateProgram = () => {
|
|
3538
3372
|
var id = GL.getNewId(GL.programs);
|
|
3539
3373
|
var program = GLctx.createProgram();
|
|
3540
3374
|
// Store additional information needed for each shader program:
|
|
@@ -3546,15 +3380,13 @@ var WebRendererWasmFactory = function () {
|
|
|
3546
3380
|
GL.programs[id] = program;
|
|
3547
3381
|
return id;
|
|
3548
3382
|
};
|
|
3549
|
-
var _glCreateShader =
|
|
3383
|
+
var _glCreateShader = shaderType => {
|
|
3550
3384
|
var id = GL.getNewId(GL.shaders);
|
|
3551
3385
|
GL.shaders[id] = GLctx.createShader(shaderType);
|
|
3552
3386
|
return id;
|
|
3553
3387
|
};
|
|
3554
|
-
var _glCullFace =
|
|
3555
|
-
|
|
3556
|
-
};
|
|
3557
|
-
var _glDeleteBuffers = function _glDeleteBuffers(n, buffers) {
|
|
3388
|
+
var _glCullFace = x0 => GLctx.cullFace(x0);
|
|
3389
|
+
var _glDeleteBuffers = (n, buffers) => {
|
|
3558
3390
|
for (var i = 0; i < n; i++) {
|
|
3559
3391
|
var id = HEAP32[buffers + i * 4 >> 2];
|
|
3560
3392
|
var buffer = GL.buffers[id];
|
|
@@ -3569,7 +3401,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3569
3401
|
if (id == GLctx.currentPixelUnpackBufferBinding) GLctx.currentPixelUnpackBufferBinding = 0;
|
|
3570
3402
|
}
|
|
3571
3403
|
};
|
|
3572
|
-
var _glDeleteFramebuffers =
|
|
3404
|
+
var _glDeleteFramebuffers = (n, framebuffers) => {
|
|
3573
3405
|
for (var i = 0; i < n; ++i) {
|
|
3574
3406
|
var id = HEAP32[framebuffers + i * 4 >> 2];
|
|
3575
3407
|
var framebuffer = GL.framebuffers[id];
|
|
@@ -3579,7 +3411,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3579
3411
|
GL.framebuffers[id] = null;
|
|
3580
3412
|
}
|
|
3581
3413
|
};
|
|
3582
|
-
var _glDeleteProgram =
|
|
3414
|
+
var _glDeleteProgram = id => {
|
|
3583
3415
|
if (!id) return;
|
|
3584
3416
|
var program = GL.programs[id];
|
|
3585
3417
|
if (!program) {
|
|
@@ -3592,7 +3424,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3592
3424
|
program.name = 0;
|
|
3593
3425
|
GL.programs[id] = null;
|
|
3594
3426
|
};
|
|
3595
|
-
var _glDeleteRenderbuffers =
|
|
3427
|
+
var _glDeleteRenderbuffers = (n, renderbuffers) => {
|
|
3596
3428
|
for (var i = 0; i < n; i++) {
|
|
3597
3429
|
var id = HEAP32[renderbuffers + i * 4 >> 2];
|
|
3598
3430
|
var renderbuffer = GL.renderbuffers[id];
|
|
@@ -3602,7 +3434,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3602
3434
|
GL.renderbuffers[id] = null;
|
|
3603
3435
|
}
|
|
3604
3436
|
};
|
|
3605
|
-
var _glDeleteSamplers =
|
|
3437
|
+
var _glDeleteSamplers = (n, samplers) => {
|
|
3606
3438
|
for (var i = 0; i < n; i++) {
|
|
3607
3439
|
var id = HEAP32[samplers + i * 4 >> 2];
|
|
3608
3440
|
var sampler = GL.samplers[id];
|
|
@@ -3612,7 +3444,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3612
3444
|
GL.samplers[id] = null;
|
|
3613
3445
|
}
|
|
3614
3446
|
};
|
|
3615
|
-
var _glDeleteShader =
|
|
3447
|
+
var _glDeleteShader = id => {
|
|
3616
3448
|
if (!id) return;
|
|
3617
3449
|
var shader = GL.shaders[id];
|
|
3618
3450
|
if (!shader) {
|
|
@@ -3624,7 +3456,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3624
3456
|
GLctx.deleteShader(shader);
|
|
3625
3457
|
GL.shaders[id] = null;
|
|
3626
3458
|
};
|
|
3627
|
-
var _glDeleteSync =
|
|
3459
|
+
var _glDeleteSync = id => {
|
|
3628
3460
|
if (!id) return;
|
|
3629
3461
|
var sync = GL.syncs[id];
|
|
3630
3462
|
if (!sync) {
|
|
@@ -3636,7 +3468,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3636
3468
|
sync.name = 0;
|
|
3637
3469
|
GL.syncs[id] = null;
|
|
3638
3470
|
};
|
|
3639
|
-
var _glDeleteTextures =
|
|
3471
|
+
var _glDeleteTextures = (n, textures) => {
|
|
3640
3472
|
for (var i = 0; i < n; i++) {
|
|
3641
3473
|
var id = HEAP32[textures + i * 4 >> 2];
|
|
3642
3474
|
var texture = GL.textures[id];
|
|
@@ -3648,7 +3480,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3648
3480
|
GL.textures[id] = null;
|
|
3649
3481
|
}
|
|
3650
3482
|
};
|
|
3651
|
-
var _glDeleteVertexArrays =
|
|
3483
|
+
var _glDeleteVertexArrays = (n, vaos) => {
|
|
3652
3484
|
for (var i = 0; i < n; i++) {
|
|
3653
3485
|
var id = HEAP32[vaos + i * 4 >> 2];
|
|
3654
3486
|
GLctx.deleteVertexArray(GL.vaos[id]);
|
|
@@ -3656,55 +3488,51 @@ var WebRendererWasmFactory = function () {
|
|
|
3656
3488
|
}
|
|
3657
3489
|
};
|
|
3658
3490
|
var _glDeleteVertexArraysOES = _glDeleteVertexArrays;
|
|
3659
|
-
var _glDepthMask =
|
|
3491
|
+
var _glDepthMask = flag => {
|
|
3660
3492
|
GLctx.depthMask(!!flag);
|
|
3661
3493
|
};
|
|
3662
|
-
var _glDisable =
|
|
3663
|
-
|
|
3664
|
-
};
|
|
3665
|
-
var _glDisableVertexAttribArray = function _glDisableVertexAttribArray(index) {
|
|
3494
|
+
var _glDisable = x0 => GLctx.disable(x0);
|
|
3495
|
+
var _glDisableVertexAttribArray = index => {
|
|
3666
3496
|
GLctx.disableVertexAttribArray(index);
|
|
3667
3497
|
};
|
|
3668
|
-
var _glDrawArrays =
|
|
3498
|
+
var _glDrawArrays = (mode, first, count) => {
|
|
3669
3499
|
GLctx.drawArrays(mode, first, count);
|
|
3670
3500
|
};
|
|
3671
|
-
var _glDrawArraysInstanced =
|
|
3501
|
+
var _glDrawArraysInstanced = (mode, first, count, primcount) => {
|
|
3672
3502
|
GLctx.drawArraysInstanced(mode, first, count, primcount);
|
|
3673
3503
|
};
|
|
3674
|
-
var _glDrawArraysInstancedBaseInstanceWEBGL =
|
|
3504
|
+
var _glDrawArraysInstancedBaseInstanceWEBGL = (mode, first, count, instanceCount, baseInstance) => {
|
|
3675
3505
|
GLctx.dibvbi['drawArraysInstancedBaseInstanceWEBGL'](mode, first, count, instanceCount, baseInstance);
|
|
3676
3506
|
};
|
|
3677
3507
|
var tempFixedLengthArray = [];
|
|
3678
|
-
var _glDrawBuffers =
|
|
3508
|
+
var _glDrawBuffers = (n, bufs) => {
|
|
3679
3509
|
var bufArray = tempFixedLengthArray[n];
|
|
3680
3510
|
for (var i = 0; i < n; i++) {
|
|
3681
3511
|
bufArray[i] = HEAP32[bufs + i * 4 >> 2];
|
|
3682
3512
|
}
|
|
3683
3513
|
GLctx.drawBuffers(bufArray);
|
|
3684
3514
|
};
|
|
3685
|
-
var _glDrawElements =
|
|
3515
|
+
var _glDrawElements = (mode, count, type, indices) => {
|
|
3686
3516
|
GLctx.drawElements(mode, count, type, indices);
|
|
3687
3517
|
};
|
|
3688
|
-
var _glDrawElementsInstanced =
|
|
3518
|
+
var _glDrawElementsInstanced = (mode, count, type, indices, primcount) => {
|
|
3689
3519
|
GLctx.drawElementsInstanced(mode, count, type, indices, primcount);
|
|
3690
3520
|
};
|
|
3691
|
-
var _glDrawElementsInstancedBaseVertexBaseInstanceWEBGL =
|
|
3521
|
+
var _glDrawElementsInstancedBaseVertexBaseInstanceWEBGL = (mode, count, type, offset, instanceCount, baseVertex, baseinstance) => {
|
|
3692
3522
|
GLctx.dibvbi['drawElementsInstancedBaseVertexBaseInstanceWEBGL'](mode, count, type, offset, instanceCount, baseVertex, baseinstance);
|
|
3693
3523
|
};
|
|
3694
|
-
var _glDrawRangeElements =
|
|
3524
|
+
var _glDrawRangeElements = (mode, start, end, count, type, indices) => {
|
|
3695
3525
|
// TODO: This should be a trivial pass-though function registered at the bottom of this page as
|
|
3696
3526
|
// glFuncs[6][1] += ' drawRangeElements';
|
|
3697
3527
|
// but due to https://bugzilla.mozilla.org/show_bug.cgi?id=1202427,
|
|
3698
3528
|
// we work around by ignoring the range.
|
|
3699
3529
|
_glDrawElements(mode, count, type, indices);
|
|
3700
3530
|
};
|
|
3701
|
-
var _glEnable =
|
|
3702
|
-
|
|
3703
|
-
};
|
|
3704
|
-
var _glEnableVertexAttribArray = function _glEnableVertexAttribArray(index) {
|
|
3531
|
+
var _glEnable = x0 => GLctx.enable(x0);
|
|
3532
|
+
var _glEnableVertexAttribArray = index => {
|
|
3705
3533
|
GLctx.enableVertexAttribArray(index);
|
|
3706
3534
|
};
|
|
3707
|
-
var _glFenceSync =
|
|
3535
|
+
var _glFenceSync = (condition, flags) => {
|
|
3708
3536
|
var sync = GLctx.fenceSync(condition, flags);
|
|
3709
3537
|
if (sync) {
|
|
3710
3538
|
var id = GL.getNewId(GL.syncs);
|
|
@@ -3714,44 +3542,36 @@ var WebRendererWasmFactory = function () {
|
|
|
3714
3542
|
}
|
|
3715
3543
|
return 0; // Failed to create a sync object
|
|
3716
3544
|
};
|
|
3717
|
-
var _glFinish =
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
var _glFlush = function _glFlush() {
|
|
3721
|
-
return GLctx.flush();
|
|
3722
|
-
};
|
|
3723
|
-
var _glFramebufferRenderbuffer = function _glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) {
|
|
3545
|
+
var _glFinish = () => GLctx.finish();
|
|
3546
|
+
var _glFlush = () => GLctx.flush();
|
|
3547
|
+
var _glFramebufferRenderbuffer = (target, attachment, renderbuffertarget, renderbuffer) => {
|
|
3724
3548
|
GLctx.framebufferRenderbuffer(target, attachment, renderbuffertarget, GL.renderbuffers[renderbuffer]);
|
|
3725
3549
|
};
|
|
3726
|
-
var _glFramebufferTexture2D =
|
|
3550
|
+
var _glFramebufferTexture2D = (target, attachment, textarget, texture, level) => {
|
|
3727
3551
|
GLctx.framebufferTexture2D(target, attachment, textarget, GL.textures[texture], level);
|
|
3728
3552
|
};
|
|
3729
|
-
var _glFrontFace =
|
|
3730
|
-
|
|
3731
|
-
};
|
|
3732
|
-
var _glGenBuffers = function _glGenBuffers(n, buffers) {
|
|
3553
|
+
var _glFrontFace = x0 => GLctx.frontFace(x0);
|
|
3554
|
+
var _glGenBuffers = (n, buffers) => {
|
|
3733
3555
|
GL.genObject(n, buffers, 'createBuffer', GL.buffers);
|
|
3734
3556
|
};
|
|
3735
|
-
var _glGenFramebuffers =
|
|
3557
|
+
var _glGenFramebuffers = (n, ids) => {
|
|
3736
3558
|
GL.genObject(n, ids, 'createFramebuffer', GL.framebuffers);
|
|
3737
3559
|
};
|
|
3738
|
-
var _glGenRenderbuffers =
|
|
3560
|
+
var _glGenRenderbuffers = (n, renderbuffers) => {
|
|
3739
3561
|
GL.genObject(n, renderbuffers, 'createRenderbuffer', GL.renderbuffers);
|
|
3740
3562
|
};
|
|
3741
|
-
var _glGenSamplers =
|
|
3563
|
+
var _glGenSamplers = (n, samplers) => {
|
|
3742
3564
|
GL.genObject(n, samplers, 'createSampler', GL.samplers);
|
|
3743
3565
|
};
|
|
3744
|
-
var _glGenTextures =
|
|
3566
|
+
var _glGenTextures = (n, textures) => {
|
|
3745
3567
|
GL.genObject(n, textures, 'createTexture', GL.textures);
|
|
3746
3568
|
};
|
|
3747
|
-
var _glGenVertexArrays =
|
|
3569
|
+
var _glGenVertexArrays = (n, arrays) => {
|
|
3748
3570
|
GL.genObject(n, arrays, 'createVertexArray', GL.vaos);
|
|
3749
3571
|
};
|
|
3750
3572
|
var _glGenVertexArraysOES = _glGenVertexArrays;
|
|
3751
|
-
var _glGenerateMipmap =
|
|
3752
|
-
|
|
3753
|
-
};
|
|
3754
|
-
var _glGetBufferParameteriv = function _glGetBufferParameteriv(target, value, data) {
|
|
3573
|
+
var _glGenerateMipmap = x0 => GLctx.generateMipmap(x0);
|
|
3574
|
+
var _glGetBufferParameteriv = (target, value, data) => {
|
|
3755
3575
|
if (!data) {
|
|
3756
3576
|
// GLES2 specification does not specify how to behave if data is a null
|
|
3757
3577
|
// pointer. Since calling this function does not make sense if data ==
|
|
@@ -3761,33 +3581,31 @@ var WebRendererWasmFactory = function () {
|
|
|
3761
3581
|
}
|
|
3762
3582
|
HEAP32[data >> 2] = GLctx.getBufferParameter(target, value);
|
|
3763
3583
|
};
|
|
3764
|
-
var _glGetError =
|
|
3584
|
+
var _glGetError = () => {
|
|
3765
3585
|
var error = GLctx.getError() || GL.lastError;
|
|
3766
3586
|
GL.lastError = 0 /*GL_NO_ERROR*/;
|
|
3767
3587
|
return error;
|
|
3768
3588
|
};
|
|
3769
|
-
var readI53FromI64 =
|
|
3589
|
+
var readI53FromI64 = ptr => {
|
|
3770
3590
|
return HEAPU32[ptr >> 2] + HEAP32[ptr + 4 >> 2] * 4294967296;
|
|
3771
3591
|
};
|
|
3772
|
-
var readI53FromU64 =
|
|
3592
|
+
var readI53FromU64 = ptr => {
|
|
3773
3593
|
return HEAPU32[ptr >> 2] + HEAPU32[ptr + 4 >> 2] * 4294967296;
|
|
3774
3594
|
};
|
|
3775
|
-
var writeI53ToI64 =
|
|
3595
|
+
var writeI53ToI64 = (ptr, num) => {
|
|
3776
3596
|
HEAPU32[ptr >> 2] = num;
|
|
3777
3597
|
var lower = HEAPU32[ptr >> 2];
|
|
3778
3598
|
HEAPU32[ptr + 4 >> 2] = (num - lower) / 4294967296;
|
|
3779
3599
|
var deserialized = num >= 0 ? readI53FromU64(ptr) : readI53FromI64(ptr);
|
|
3780
3600
|
var offset = ptr >> 2;
|
|
3781
|
-
if (deserialized != num)
|
|
3601
|
+
if (deserialized != num) warnOnce("writeI53ToI64() out of range: serialized JS Number ".concat(num, " to Wasm heap as bytes lo=").concat(ptrToString(HEAPU32[offset]), ", hi=").concat(ptrToString(HEAPU32[offset + 1]), ", which deserializes back to ").concat(deserialized, " instead!"));
|
|
3782
3602
|
};
|
|
3783
3603
|
var webglGetExtensions = function $webglGetExtensions() {
|
|
3784
3604
|
var exts = getEmscriptenSupportedExtensions(GLctx);
|
|
3785
|
-
exts = exts.concat(exts.map(
|
|
3786
|
-
return "GL_" + e;
|
|
3787
|
-
}));
|
|
3605
|
+
exts = exts.concat(exts.map(e => "GL_" + e));
|
|
3788
3606
|
return exts;
|
|
3789
3607
|
};
|
|
3790
|
-
var emscriptenWebGLGet =
|
|
3608
|
+
var emscriptenWebGLGet = (name_, p, type) => {
|
|
3791
3609
|
// Guard against user passing a null pointer.
|
|
3792
3610
|
// Note that GLES2 spec does not say anything about how passing a null
|
|
3793
3611
|
// pointer should be treated. Testing on desktop core GL 3, the application
|
|
@@ -3847,7 +3665,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3847
3665
|
}
|
|
3848
3666
|
if (ret === undefined) {
|
|
3849
3667
|
var result = GLctx.getParameter(name_);
|
|
3850
|
-
switch (
|
|
3668
|
+
switch (typeof result) {
|
|
3851
3669
|
case "number":
|
|
3852
3670
|
ret = result;
|
|
3853
3671
|
break;
|
|
@@ -3920,7 +3738,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3920
3738
|
break;
|
|
3921
3739
|
default:
|
|
3922
3740
|
GL.recordError(0x500); // GL_INVALID_ENUM
|
|
3923
|
-
err("GL_INVALID_ENUM in glGet".concat(type, "v: Native code calling glGet").concat(type, "v(").concat(name_, ") and it returns ").concat(result, " of type ").concat(
|
|
3741
|
+
err("GL_INVALID_ENUM in glGet".concat(type, "v: Native code calling glGet").concat(type, "v(").concat(name_, ") and it returns ").concat(result, " of type ").concat(typeof result, "!"));
|
|
3924
3742
|
return;
|
|
3925
3743
|
}
|
|
3926
3744
|
}
|
|
@@ -3939,26 +3757,22 @@ var WebRendererWasmFactory = function () {
|
|
|
3939
3757
|
break;
|
|
3940
3758
|
}
|
|
3941
3759
|
};
|
|
3942
|
-
var _glGetFloatv =
|
|
3943
|
-
|
|
3944
|
-
};
|
|
3945
|
-
var _glGetFramebufferAttachmentParameteriv = function _glGetFramebufferAttachmentParameteriv(target, attachment, pname, params) {
|
|
3760
|
+
var _glGetFloatv = (name_, p) => emscriptenWebGLGet(name_, p, 2);
|
|
3761
|
+
var _glGetFramebufferAttachmentParameteriv = (target, attachment, pname, params) => {
|
|
3946
3762
|
var result = GLctx.getFramebufferAttachmentParameter(target, attachment, pname);
|
|
3947
3763
|
if (result instanceof WebGLRenderbuffer || result instanceof WebGLTexture) {
|
|
3948
3764
|
result = result.name | 0;
|
|
3949
3765
|
}
|
|
3950
3766
|
HEAP32[params >> 2] = result;
|
|
3951
3767
|
};
|
|
3952
|
-
var _glGetIntegerv =
|
|
3953
|
-
|
|
3954
|
-
};
|
|
3955
|
-
var _glGetProgramInfoLog = function _glGetProgramInfoLog(program, maxLength, length, infoLog) {
|
|
3768
|
+
var _glGetIntegerv = (name_, p) => emscriptenWebGLGet(name_, p, 0);
|
|
3769
|
+
var _glGetProgramInfoLog = (program, maxLength, length, infoLog) => {
|
|
3956
3770
|
var log = GLctx.getProgramInfoLog(GL.programs[program]);
|
|
3957
3771
|
if (log === null) log = '(unknown error)';
|
|
3958
3772
|
var numBytesWrittenExclNull = maxLength > 0 && infoLog ? stringToUTF8(log, infoLog, maxLength) : 0;
|
|
3959
3773
|
if (length) HEAP32[length >> 2] = numBytesWrittenExclNull;
|
|
3960
3774
|
};
|
|
3961
|
-
var _glGetProgramiv =
|
|
3775
|
+
var _glGetProgramiv = (program, pname, p) => {
|
|
3962
3776
|
if (!p) {
|
|
3963
3777
|
// GLES2 specification does not specify how to behave if p is a null
|
|
3964
3778
|
// pointer. Since calling this function does not make sense if p == null,
|
|
@@ -4001,7 +3815,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4001
3815
|
HEAP32[p >> 2] = GLctx.getProgramParameter(program, pname);
|
|
4002
3816
|
}
|
|
4003
3817
|
};
|
|
4004
|
-
var _glGetRenderbufferParameteriv =
|
|
3818
|
+
var _glGetRenderbufferParameteriv = (target, pname, params) => {
|
|
4005
3819
|
if (!params) {
|
|
4006
3820
|
// GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
|
|
4007
3821
|
// if params == null, issue a GL error to notify user about it.
|
|
@@ -4010,19 +3824,19 @@ var WebRendererWasmFactory = function () {
|
|
|
4010
3824
|
}
|
|
4011
3825
|
HEAP32[params >> 2] = GLctx.getRenderbufferParameter(target, pname);
|
|
4012
3826
|
};
|
|
4013
|
-
var _glGetShaderInfoLog =
|
|
3827
|
+
var _glGetShaderInfoLog = (shader, maxLength, length, infoLog) => {
|
|
4014
3828
|
var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
|
|
4015
3829
|
if (log === null) log = '(unknown error)';
|
|
4016
3830
|
var numBytesWrittenExclNull = maxLength > 0 && infoLog ? stringToUTF8(log, infoLog, maxLength) : 0;
|
|
4017
3831
|
if (length) HEAP32[length >> 2] = numBytesWrittenExclNull;
|
|
4018
3832
|
};
|
|
4019
|
-
var _glGetShaderPrecisionFormat =
|
|
3833
|
+
var _glGetShaderPrecisionFormat = (shaderType, precisionType, range, precision) => {
|
|
4020
3834
|
var result = GLctx.getShaderPrecisionFormat(shaderType, precisionType);
|
|
4021
3835
|
HEAP32[range >> 2] = result.rangeMin;
|
|
4022
3836
|
HEAP32[range + 4 >> 2] = result.rangeMax;
|
|
4023
3837
|
HEAP32[precision >> 2] = result.precision;
|
|
4024
3838
|
};
|
|
4025
|
-
var _glGetShaderiv =
|
|
3839
|
+
var _glGetShaderiv = (shader, pname, p) => {
|
|
4026
3840
|
if (!p) {
|
|
4027
3841
|
// GLES2 specification does not specify how to behave if p is a null
|
|
4028
3842
|
// pointer. Since calling this function does not make sense if p == null,
|
|
@@ -4051,13 +3865,13 @@ var WebRendererWasmFactory = function () {
|
|
|
4051
3865
|
HEAP32[p >> 2] = GLctx.getShaderParameter(GL.shaders[shader], pname);
|
|
4052
3866
|
}
|
|
4053
3867
|
};
|
|
4054
|
-
var stringToNewUTF8 =
|
|
3868
|
+
var stringToNewUTF8 = str => {
|
|
4055
3869
|
var size = lengthBytesUTF8(str) + 1;
|
|
4056
3870
|
var ret = _malloc(size);
|
|
4057
3871
|
if (ret) stringToUTF8(str, ret, size);
|
|
4058
3872
|
return ret;
|
|
4059
3873
|
};
|
|
4060
|
-
var _glGetString =
|
|
3874
|
+
var _glGetString = name_ => {
|
|
4061
3875
|
var ret = GL.stringCache[name_];
|
|
4062
3876
|
if (!ret) {
|
|
4063
3877
|
switch (name_) {
|
|
@@ -4101,7 +3915,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4101
3915
|
}
|
|
4102
3916
|
return ret;
|
|
4103
3917
|
};
|
|
4104
|
-
var _glGetStringi =
|
|
3918
|
+
var _glGetStringi = (name, index) => {
|
|
4105
3919
|
if (GL.currentContext.version < 2) {
|
|
4106
3920
|
GL.recordError(0x502 /* GL_INVALID_OPERATION */); // Calling GLES3/WebGL2 function with a GLES2/WebGL1 context
|
|
4107
3921
|
return 0;
|
|
@@ -4130,15 +3944,11 @@ var WebRendererWasmFactory = function () {
|
|
|
4130
3944
|
};
|
|
4131
3945
|
|
|
4132
3946
|
/** @suppress {checkTypes} */
|
|
4133
|
-
var jstoi_q =
|
|
4134
|
-
return parseInt(str);
|
|
4135
|
-
};
|
|
3947
|
+
var jstoi_q = str => parseInt(str);
|
|
4136
3948
|
|
|
4137
3949
|
/** @noinline */
|
|
4138
|
-
var webglGetLeftBracePos =
|
|
4139
|
-
|
|
4140
|
-
};
|
|
4141
|
-
var webglPrepareUniformLocationsBeforeFirstUse = function webglPrepareUniformLocationsBeforeFirstUse(program) {
|
|
3950
|
+
var webglGetLeftBracePos = name => name.slice(-1) == ']' && name.lastIndexOf('[');
|
|
3951
|
+
var webglPrepareUniformLocationsBeforeFirstUse = program => {
|
|
4142
3952
|
var uniformLocsById = program.uniformLocsById,
|
|
4143
3953
|
// Maps GLuint -> WebGLUniformLocation
|
|
4144
3954
|
uniformSizeAndIdsByName = program.uniformSizeAndIdsByName,
|
|
@@ -4179,7 +3989,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4179
3989
|
}
|
|
4180
3990
|
}
|
|
4181
3991
|
};
|
|
4182
|
-
var _glGetUniformLocation =
|
|
3992
|
+
var _glGetUniformLocation = (program, name) => {
|
|
4183
3993
|
name = UTF8ToString(name);
|
|
4184
3994
|
if (program = GL.programs[program]) {
|
|
4185
3995
|
webglPrepareUniformLocationsBeforeFirstUse(program);
|
|
@@ -4224,54 +4034,48 @@ var WebRendererWasmFactory = function () {
|
|
|
4224
4034
|
}
|
|
4225
4035
|
return -1;
|
|
4226
4036
|
};
|
|
4227
|
-
var _glInvalidateFramebuffer =
|
|
4037
|
+
var _glInvalidateFramebuffer = (target, numAttachments, attachments) => {
|
|
4228
4038
|
var list = tempFixedLengthArray[numAttachments];
|
|
4229
4039
|
for (var i = 0; i < numAttachments; i++) {
|
|
4230
4040
|
list[i] = HEAP32[attachments + i * 4 >> 2];
|
|
4231
4041
|
}
|
|
4232
4042
|
GLctx.invalidateFramebuffer(target, list);
|
|
4233
4043
|
};
|
|
4234
|
-
var _glInvalidateSubFramebuffer =
|
|
4044
|
+
var _glInvalidateSubFramebuffer = (target, numAttachments, attachments, x, y, width, height) => {
|
|
4235
4045
|
var list = tempFixedLengthArray[numAttachments];
|
|
4236
4046
|
for (var i = 0; i < numAttachments; i++) {
|
|
4237
4047
|
list[i] = HEAP32[attachments + i * 4 >> 2];
|
|
4238
4048
|
}
|
|
4239
4049
|
GLctx.invalidateSubFramebuffer(target, list, x, y, width, height);
|
|
4240
4050
|
};
|
|
4241
|
-
var _glIsSync =
|
|
4242
|
-
|
|
4243
|
-
};
|
|
4244
|
-
var _glIsTexture = function _glIsTexture(id) {
|
|
4051
|
+
var _glIsSync = sync => GLctx.isSync(GL.syncs[sync]);
|
|
4052
|
+
var _glIsTexture = id => {
|
|
4245
4053
|
var texture = GL.textures[id];
|
|
4246
4054
|
if (!texture) return 0;
|
|
4247
4055
|
return GLctx.isTexture(texture);
|
|
4248
4056
|
};
|
|
4249
|
-
var _glLineWidth =
|
|
4250
|
-
|
|
4251
|
-
};
|
|
4252
|
-
var _glLinkProgram = function _glLinkProgram(program) {
|
|
4057
|
+
var _glLineWidth = x0 => GLctx.lineWidth(x0);
|
|
4058
|
+
var _glLinkProgram = program => {
|
|
4253
4059
|
program = GL.programs[program];
|
|
4254
4060
|
GLctx.linkProgram(program);
|
|
4255
4061
|
// Invalidate earlier computed uniform->ID mappings, those have now become stale
|
|
4256
4062
|
program.uniformLocsById = 0; // Mark as null-like so that glGetUniformLocation() knows to populate this again.
|
|
4257
4063
|
program.uniformSizeAndIdsByName = {};
|
|
4258
4064
|
};
|
|
4259
|
-
var _glMultiDrawArraysInstancedBaseInstanceWEBGL =
|
|
4065
|
+
var _glMultiDrawArraysInstancedBaseInstanceWEBGL = (mode, firsts, counts, instanceCounts, baseInstances, drawCount) => {
|
|
4260
4066
|
GLctx.mdibvbi['multiDrawArraysInstancedBaseInstanceWEBGL'](mode, HEAP32, firsts >> 2, HEAP32, counts >> 2, HEAP32, instanceCounts >> 2, HEAPU32, baseInstances >> 2, drawCount);
|
|
4261
4067
|
};
|
|
4262
|
-
var _glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL =
|
|
4068
|
+
var _glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL = (mode, counts, type, offsets, instanceCounts, baseVertices, baseInstances, drawCount) => {
|
|
4263
4069
|
GLctx.mdibvbi['multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL'](mode, HEAP32, counts >> 2, type, HEAP32, offsets >> 2, HEAP32, instanceCounts >> 2, HEAP32, baseVertices >> 2, HEAPU32, baseInstances >> 2, drawCount);
|
|
4264
4070
|
};
|
|
4265
|
-
var _glPixelStorei =
|
|
4071
|
+
var _glPixelStorei = (pname, param) => {
|
|
4266
4072
|
if (pname == 0xCF5 /* GL_UNPACK_ALIGNMENT */) {
|
|
4267
4073
|
GL.unpackAlignment = param;
|
|
4268
4074
|
}
|
|
4269
4075
|
GLctx.pixelStorei(pname, param);
|
|
4270
4076
|
};
|
|
4271
|
-
var _glReadBuffer =
|
|
4272
|
-
|
|
4273
|
-
};
|
|
4274
|
-
var computeUnpackAlignedImageSize = function computeUnpackAlignedImageSize(width, height, sizePerPixel, alignment) {
|
|
4077
|
+
var _glReadBuffer = x0 => GLctx.readBuffer(x0);
|
|
4078
|
+
var computeUnpackAlignedImageSize = (width, height, sizePerPixel, alignment) => {
|
|
4275
4079
|
function roundedToNextMultipleOf(x, y) {
|
|
4276
4080
|
return x + y - 1 & -y;
|
|
4277
4081
|
}
|
|
@@ -4279,7 +4083,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4279
4083
|
var alignedRowSize = roundedToNextMultipleOf(plainRowSize, alignment);
|
|
4280
4084
|
return height * alignedRowSize;
|
|
4281
4085
|
};
|
|
4282
|
-
var colorChannelsInGlTextureFormat =
|
|
4086
|
+
var colorChannelsInGlTextureFormat = format => {
|
|
4283
4087
|
// Micro-optimizations for size: map format to size by subtracting smallest
|
|
4284
4088
|
// enum value (0x1902) from all values first. Also omit the most common
|
|
4285
4089
|
// size value (1) from the list, which is assumed by formats not on the
|
|
@@ -4302,7 +4106,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4302
4106
|
};
|
|
4303
4107
|
return colorChannels[format - 0x1902] || 1;
|
|
4304
4108
|
};
|
|
4305
|
-
var heapObjectForWebGLType =
|
|
4109
|
+
var heapObjectForWebGLType = type => {
|
|
4306
4110
|
// Micro-optimization for size: Subtract lowest GL enum number (0x1400/* GL_BYTE */) from type to compare
|
|
4307
4111
|
// smaller values for the heap, for shorter generated code size.
|
|
4308
4112
|
// Also the type HEAPU16 is not tested for explicitly, but any unrecognized type will return out HEAPU16.
|
|
@@ -4316,16 +4120,14 @@ var WebRendererWasmFactory = function () {
|
|
|
4316
4120
|
if (type == 5 || type == 28922 || type == 28520 || type == 30779 || type == 30782) return HEAPU32;
|
|
4317
4121
|
return HEAPU16;
|
|
4318
4122
|
};
|
|
4319
|
-
var toTypedArrayIndex =
|
|
4320
|
-
|
|
4321
|
-
};
|
|
4322
|
-
var emscriptenWebGLGetTexPixelData = function emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat) {
|
|
4123
|
+
var toTypedArrayIndex = (pointer, heap) => pointer >>> 31 - Math.clz32(heap.BYTES_PER_ELEMENT);
|
|
4124
|
+
var emscriptenWebGLGetTexPixelData = (type, format, width, height, pixels, internalFormat) => {
|
|
4323
4125
|
var heap = heapObjectForWebGLType(type);
|
|
4324
4126
|
var sizePerPixel = colorChannelsInGlTextureFormat(format) * heap.BYTES_PER_ELEMENT;
|
|
4325
4127
|
var bytes = computeUnpackAlignedImageSize(width, height, sizePerPixel, GL.unpackAlignment);
|
|
4326
4128
|
return heap.subarray(toTypedArrayIndex(pixels, heap), toTypedArrayIndex(pixels + bytes, heap));
|
|
4327
4129
|
};
|
|
4328
|
-
var _glReadPixels =
|
|
4130
|
+
var _glReadPixels = (x, y, width, height, format, type, pixels) => {
|
|
4329
4131
|
if (GL.currentContext.version >= 2) {
|
|
4330
4132
|
if (GLctx.currentPixelPackBufferBinding) {
|
|
4331
4133
|
GLctx.readPixels(x, y, width, height, format, type, pixels);
|
|
@@ -4343,48 +4145,30 @@ var WebRendererWasmFactory = function () {
|
|
|
4343
4145
|
}
|
|
4344
4146
|
GLctx.readPixels(x, y, width, height, format, type, pixelData);
|
|
4345
4147
|
};
|
|
4346
|
-
var _glRenderbufferStorage =
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
var _glRenderbufferStorageMultisample = function _glRenderbufferStorageMultisample(x0, x1, x2, x3, x4) {
|
|
4350
|
-
return GLctx.renderbufferStorageMultisample(x0, x1, x2, x3, x4);
|
|
4351
|
-
};
|
|
4352
|
-
var _glSamplerParameterf = function _glSamplerParameterf(sampler, pname, param) {
|
|
4148
|
+
var _glRenderbufferStorage = (x0, x1, x2, x3) => GLctx.renderbufferStorage(x0, x1, x2, x3);
|
|
4149
|
+
var _glRenderbufferStorageMultisample = (x0, x1, x2, x3, x4) => GLctx.renderbufferStorageMultisample(x0, x1, x2, x3, x4);
|
|
4150
|
+
var _glSamplerParameterf = (sampler, pname, param) => {
|
|
4353
4151
|
GLctx.samplerParameterf(GL.samplers[sampler], pname, param);
|
|
4354
4152
|
};
|
|
4355
|
-
var _glSamplerParameteri =
|
|
4153
|
+
var _glSamplerParameteri = (sampler, pname, param) => {
|
|
4356
4154
|
GLctx.samplerParameteri(GL.samplers[sampler], pname, param);
|
|
4357
4155
|
};
|
|
4358
|
-
var _glSamplerParameteriv =
|
|
4156
|
+
var _glSamplerParameteriv = (sampler, pname, params) => {
|
|
4359
4157
|
var param = HEAP32[params >> 2];
|
|
4360
4158
|
GLctx.samplerParameteri(GL.samplers[sampler], pname, param);
|
|
4361
4159
|
};
|
|
4362
|
-
var _glScissor =
|
|
4363
|
-
|
|
4364
|
-
};
|
|
4365
|
-
var _glShaderSource = function _glShaderSource(shader, count, string, length) {
|
|
4160
|
+
var _glScissor = (x0, x1, x2, x3) => GLctx.scissor(x0, x1, x2, x3);
|
|
4161
|
+
var _glShaderSource = (shader, count, string, length) => {
|
|
4366
4162
|
var source = GL.getSource(shader, count, string, length);
|
|
4367
4163
|
GLctx.shaderSource(GL.shaders[shader], source);
|
|
4368
4164
|
};
|
|
4369
|
-
var _glStencilFunc =
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
var
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
var
|
|
4376
|
-
return GLctx.stencilMask(x0);
|
|
4377
|
-
};
|
|
4378
|
-
var _glStencilMaskSeparate = function _glStencilMaskSeparate(x0, x1) {
|
|
4379
|
-
return GLctx.stencilMaskSeparate(x0, x1);
|
|
4380
|
-
};
|
|
4381
|
-
var _glStencilOp = function _glStencilOp(x0, x1, x2) {
|
|
4382
|
-
return GLctx.stencilOp(x0, x1, x2);
|
|
4383
|
-
};
|
|
4384
|
-
var _glStencilOpSeparate = function _glStencilOpSeparate(x0, x1, x2, x3) {
|
|
4385
|
-
return GLctx.stencilOpSeparate(x0, x1, x2, x3);
|
|
4386
|
-
};
|
|
4387
|
-
var _glTexImage2D = function _glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels) {
|
|
4165
|
+
var _glStencilFunc = (x0, x1, x2) => GLctx.stencilFunc(x0, x1, x2);
|
|
4166
|
+
var _glStencilFuncSeparate = (x0, x1, x2, x3) => GLctx.stencilFuncSeparate(x0, x1, x2, x3);
|
|
4167
|
+
var _glStencilMask = x0 => GLctx.stencilMask(x0);
|
|
4168
|
+
var _glStencilMaskSeparate = (x0, x1) => GLctx.stencilMaskSeparate(x0, x1);
|
|
4169
|
+
var _glStencilOp = (x0, x1, x2) => GLctx.stencilOp(x0, x1, x2);
|
|
4170
|
+
var _glStencilOpSeparate = (x0, x1, x2, x3) => GLctx.stencilOpSeparate(x0, x1, x2, x3);
|
|
4171
|
+
var _glTexImage2D = (target, level, internalFormat, width, height, border, format, type, pixels) => {
|
|
4388
4172
|
if (GL.currentContext.version >= 2) {
|
|
4389
4173
|
if (GLctx.currentPixelUnpackBufferBinding) {
|
|
4390
4174
|
GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
|
|
@@ -4400,24 +4184,18 @@ var WebRendererWasmFactory = function () {
|
|
|
4400
4184
|
var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels) : null;
|
|
4401
4185
|
GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
|
|
4402
4186
|
};
|
|
4403
|
-
var _glTexParameterf =
|
|
4404
|
-
|
|
4405
|
-
};
|
|
4406
|
-
var _glTexParameterfv = function _glTexParameterfv(target, pname, params) {
|
|
4187
|
+
var _glTexParameterf = (x0, x1, x2) => GLctx.texParameterf(x0, x1, x2);
|
|
4188
|
+
var _glTexParameterfv = (target, pname, params) => {
|
|
4407
4189
|
var param = HEAPF32[params >> 2];
|
|
4408
4190
|
GLctx.texParameterf(target, pname, param);
|
|
4409
4191
|
};
|
|
4410
|
-
var _glTexParameteri =
|
|
4411
|
-
|
|
4412
|
-
};
|
|
4413
|
-
var _glTexParameteriv = function _glTexParameteriv(target, pname, params) {
|
|
4192
|
+
var _glTexParameteri = (x0, x1, x2) => GLctx.texParameteri(x0, x1, x2);
|
|
4193
|
+
var _glTexParameteriv = (target, pname, params) => {
|
|
4414
4194
|
var param = HEAP32[params >> 2];
|
|
4415
4195
|
GLctx.texParameteri(target, pname, param);
|
|
4416
4196
|
};
|
|
4417
|
-
var _glTexStorage2D =
|
|
4418
|
-
|
|
4419
|
-
};
|
|
4420
|
-
var _glTexSubImage2D = function _glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) {
|
|
4197
|
+
var _glTexStorage2D = (x0, x1, x2, x3, x4) => GLctx.texStorage2D(x0, x1, x2, x3, x4);
|
|
4198
|
+
var _glTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, type, pixels) => {
|
|
4421
4199
|
if (GL.currentContext.version >= 2) {
|
|
4422
4200
|
if (GLctx.currentPixelUnpackBufferBinding) {
|
|
4423
4201
|
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
|
@@ -4432,7 +4210,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4432
4210
|
var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels) : null;
|
|
4433
4211
|
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixelData);
|
|
4434
4212
|
};
|
|
4435
|
-
var webglGetUniformLocation =
|
|
4213
|
+
var webglGetUniformLocation = location => {
|
|
4436
4214
|
var p = GLctx.currentProgram;
|
|
4437
4215
|
if (p) {
|
|
4438
4216
|
var webglLoc = p.uniformLocsById[location];
|
|
@@ -4449,11 +4227,11 @@ var WebRendererWasmFactory = function () {
|
|
|
4449
4227
|
GL.recordError(0x502 /*GL_INVALID_OPERATION*/);
|
|
4450
4228
|
}
|
|
4451
4229
|
};
|
|
4452
|
-
var _glUniform1f =
|
|
4230
|
+
var _glUniform1f = (location, v0) => {
|
|
4453
4231
|
GLctx.uniform1f(webglGetUniformLocation(location), v0);
|
|
4454
4232
|
};
|
|
4455
4233
|
var miniTempWebGLFloatBuffers = [];
|
|
4456
|
-
var _glUniform1fv =
|
|
4234
|
+
var _glUniform1fv = (location, count, value) => {
|
|
4457
4235
|
if (GL.currentContext.version >= 2) {
|
|
4458
4236
|
count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count);
|
|
4459
4237
|
return;
|
|
@@ -4469,11 +4247,11 @@ var WebRendererWasmFactory = function () {
|
|
|
4469
4247
|
}
|
|
4470
4248
|
GLctx.uniform1fv(webglGetUniformLocation(location), view);
|
|
4471
4249
|
};
|
|
4472
|
-
var _glUniform1i =
|
|
4250
|
+
var _glUniform1i = (location, v0) => {
|
|
4473
4251
|
GLctx.uniform1i(webglGetUniformLocation(location), v0);
|
|
4474
4252
|
};
|
|
4475
4253
|
var miniTempWebGLIntBuffers = [];
|
|
4476
|
-
var _glUniform1iv =
|
|
4254
|
+
var _glUniform1iv = (location, count, value) => {
|
|
4477
4255
|
if (GL.currentContext.version >= 2) {
|
|
4478
4256
|
count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, value >> 2, count);
|
|
4479
4257
|
return;
|
|
@@ -4489,10 +4267,10 @@ var WebRendererWasmFactory = function () {
|
|
|
4489
4267
|
}
|
|
4490
4268
|
GLctx.uniform1iv(webglGetUniformLocation(location), view);
|
|
4491
4269
|
};
|
|
4492
|
-
var _glUniform2f =
|
|
4270
|
+
var _glUniform2f = (location, v0, v1) => {
|
|
4493
4271
|
GLctx.uniform2f(webglGetUniformLocation(location), v0, v1);
|
|
4494
4272
|
};
|
|
4495
|
-
var _glUniform2fv =
|
|
4273
|
+
var _glUniform2fv = (location, count, value) => {
|
|
4496
4274
|
if (GL.currentContext.version >= 2) {
|
|
4497
4275
|
count && GLctx.uniform2fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count * 2);
|
|
4498
4276
|
return;
|
|
@@ -4509,10 +4287,10 @@ var WebRendererWasmFactory = function () {
|
|
|
4509
4287
|
}
|
|
4510
4288
|
GLctx.uniform2fv(webglGetUniformLocation(location), view);
|
|
4511
4289
|
};
|
|
4512
|
-
var _glUniform2i =
|
|
4290
|
+
var _glUniform2i = (location, v0, v1) => {
|
|
4513
4291
|
GLctx.uniform2i(webglGetUniformLocation(location), v0, v1);
|
|
4514
4292
|
};
|
|
4515
|
-
var _glUniform2iv =
|
|
4293
|
+
var _glUniform2iv = (location, count, value) => {
|
|
4516
4294
|
if (GL.currentContext.version >= 2) {
|
|
4517
4295
|
count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, value >> 2, count * 2);
|
|
4518
4296
|
return;
|
|
@@ -4529,10 +4307,10 @@ var WebRendererWasmFactory = function () {
|
|
|
4529
4307
|
}
|
|
4530
4308
|
GLctx.uniform2iv(webglGetUniformLocation(location), view);
|
|
4531
4309
|
};
|
|
4532
|
-
var _glUniform3f =
|
|
4310
|
+
var _glUniform3f = (location, v0, v1, v2) => {
|
|
4533
4311
|
GLctx.uniform3f(webglGetUniformLocation(location), v0, v1, v2);
|
|
4534
4312
|
};
|
|
4535
|
-
var _glUniform3fv =
|
|
4313
|
+
var _glUniform3fv = (location, count, value) => {
|
|
4536
4314
|
if (GL.currentContext.version >= 2) {
|
|
4537
4315
|
count && GLctx.uniform3fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count * 3);
|
|
4538
4316
|
return;
|
|
@@ -4550,10 +4328,10 @@ var WebRendererWasmFactory = function () {
|
|
|
4550
4328
|
}
|
|
4551
4329
|
GLctx.uniform3fv(webglGetUniformLocation(location), view);
|
|
4552
4330
|
};
|
|
4553
|
-
var _glUniform3i =
|
|
4331
|
+
var _glUniform3i = (location, v0, v1, v2) => {
|
|
4554
4332
|
GLctx.uniform3i(webglGetUniformLocation(location), v0, v1, v2);
|
|
4555
4333
|
};
|
|
4556
|
-
var _glUniform3iv =
|
|
4334
|
+
var _glUniform3iv = (location, count, value) => {
|
|
4557
4335
|
if (GL.currentContext.version >= 2) {
|
|
4558
4336
|
count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, value >> 2, count * 3);
|
|
4559
4337
|
return;
|
|
@@ -4571,10 +4349,10 @@ var WebRendererWasmFactory = function () {
|
|
|
4571
4349
|
}
|
|
4572
4350
|
GLctx.uniform3iv(webglGetUniformLocation(location), view);
|
|
4573
4351
|
};
|
|
4574
|
-
var _glUniform4f =
|
|
4352
|
+
var _glUniform4f = (location, v0, v1, v2, v3) => {
|
|
4575
4353
|
GLctx.uniform4f(webglGetUniformLocation(location), v0, v1, v2, v3);
|
|
4576
4354
|
};
|
|
4577
|
-
var _glUniform4fv =
|
|
4355
|
+
var _glUniform4fv = (location, count, value) => {
|
|
4578
4356
|
if (GL.currentContext.version >= 2) {
|
|
4579
4357
|
count && GLctx.uniform4fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count * 4);
|
|
4580
4358
|
return;
|
|
@@ -4597,10 +4375,10 @@ var WebRendererWasmFactory = function () {
|
|
|
4597
4375
|
}
|
|
4598
4376
|
GLctx.uniform4fv(webglGetUniformLocation(location), view);
|
|
4599
4377
|
};
|
|
4600
|
-
var _glUniform4i =
|
|
4378
|
+
var _glUniform4i = (location, v0, v1, v2, v3) => {
|
|
4601
4379
|
GLctx.uniform4i(webglGetUniformLocation(location), v0, v1, v2, v3);
|
|
4602
4380
|
};
|
|
4603
|
-
var _glUniform4iv =
|
|
4381
|
+
var _glUniform4iv = (location, count, value) => {
|
|
4604
4382
|
if (GL.currentContext.version >= 2) {
|
|
4605
4383
|
count && GLctx.uniform4iv(webglGetUniformLocation(location), HEAP32, value >> 2, count * 4);
|
|
4606
4384
|
return;
|
|
@@ -4619,7 +4397,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4619
4397
|
}
|
|
4620
4398
|
GLctx.uniform4iv(webglGetUniformLocation(location), view);
|
|
4621
4399
|
};
|
|
4622
|
-
var _glUniformMatrix2fv =
|
|
4400
|
+
var _glUniformMatrix2fv = (location, count, transpose, value) => {
|
|
4623
4401
|
if (GL.currentContext.version >= 2) {
|
|
4624
4402
|
count && GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value >> 2, count * 4);
|
|
4625
4403
|
return;
|
|
@@ -4638,7 +4416,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4638
4416
|
}
|
|
4639
4417
|
GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, view);
|
|
4640
4418
|
};
|
|
4641
|
-
var _glUniformMatrix3fv =
|
|
4419
|
+
var _glUniformMatrix3fv = (location, count, transpose, value) => {
|
|
4642
4420
|
if (GL.currentContext.version >= 2) {
|
|
4643
4421
|
count && GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value >> 2, count * 9);
|
|
4644
4422
|
return;
|
|
@@ -4662,7 +4440,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4662
4440
|
}
|
|
4663
4441
|
GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, view);
|
|
4664
4442
|
};
|
|
4665
|
-
var _glUniformMatrix4fv =
|
|
4443
|
+
var _glUniformMatrix4fv = (location, count, transpose, value) => {
|
|
4666
4444
|
if (GL.currentContext.version >= 2) {
|
|
4667
4445
|
count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value >> 2, count * 16);
|
|
4668
4446
|
return;
|
|
@@ -4697,46 +4475,40 @@ var WebRendererWasmFactory = function () {
|
|
|
4697
4475
|
}
|
|
4698
4476
|
GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, view);
|
|
4699
4477
|
};
|
|
4700
|
-
var _glUseProgram =
|
|
4478
|
+
var _glUseProgram = program => {
|
|
4701
4479
|
program = GL.programs[program];
|
|
4702
4480
|
GLctx.useProgram(program);
|
|
4703
4481
|
// Record the currently active program so that we can access the uniform
|
|
4704
4482
|
// mapping table of that program.
|
|
4705
4483
|
GLctx.currentProgram = program;
|
|
4706
4484
|
};
|
|
4707
|
-
var _glVertexAttrib1f =
|
|
4708
|
-
|
|
4709
|
-
};
|
|
4710
|
-
var _glVertexAttrib2fv = function _glVertexAttrib2fv(index, v) {
|
|
4485
|
+
var _glVertexAttrib1f = (x0, x1) => GLctx.vertexAttrib1f(x0, x1);
|
|
4486
|
+
var _glVertexAttrib2fv = (index, v) => {
|
|
4711
4487
|
GLctx.vertexAttrib2f(index, HEAPF32[v >> 2], HEAPF32[v + 4 >> 2]);
|
|
4712
4488
|
};
|
|
4713
|
-
var _glVertexAttrib3fv =
|
|
4489
|
+
var _glVertexAttrib3fv = (index, v) => {
|
|
4714
4490
|
GLctx.vertexAttrib3f(index, HEAPF32[v >> 2], HEAPF32[v + 4 >> 2], HEAPF32[v + 8 >> 2]);
|
|
4715
4491
|
};
|
|
4716
|
-
var _glVertexAttrib4fv =
|
|
4492
|
+
var _glVertexAttrib4fv = (index, v) => {
|
|
4717
4493
|
GLctx.vertexAttrib4f(index, HEAPF32[v >> 2], HEAPF32[v + 4 >> 2], HEAPF32[v + 8 >> 2], HEAPF32[v + 12 >> 2]);
|
|
4718
4494
|
};
|
|
4719
|
-
var _glVertexAttribDivisor =
|
|
4495
|
+
var _glVertexAttribDivisor = (index, divisor) => {
|
|
4720
4496
|
GLctx.vertexAttribDivisor(index, divisor);
|
|
4721
4497
|
};
|
|
4722
|
-
var _glVertexAttribIPointer =
|
|
4498
|
+
var _glVertexAttribIPointer = (index, size, type, stride, ptr) => {
|
|
4723
4499
|
GLctx.vertexAttribIPointer(index, size, type, stride, ptr);
|
|
4724
4500
|
};
|
|
4725
|
-
var _glVertexAttribPointer =
|
|
4501
|
+
var _glVertexAttribPointer = (index, size, type, normalized, stride, ptr) => {
|
|
4726
4502
|
GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
|
|
4727
4503
|
};
|
|
4728
|
-
var _glViewport =
|
|
4729
|
-
|
|
4730
|
-
};
|
|
4731
|
-
var _glWaitSync = function _glWaitSync(sync, flags, timeout) {
|
|
4504
|
+
var _glViewport = (x0, x1, x2, x3) => GLctx.viewport(x0, x1, x2, x3);
|
|
4505
|
+
var _glWaitSync = (sync, flags, timeout) => {
|
|
4732
4506
|
// See WebGL2 vs GLES3 difference on GL_TIMEOUT_IGNORED above (https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.15)
|
|
4733
4507
|
timeout = Number(timeout);
|
|
4734
4508
|
GLctx.waitSync(GL.syncs[sync], flags, timeout);
|
|
4735
4509
|
};
|
|
4736
|
-
var isLeapYear =
|
|
4737
|
-
|
|
4738
|
-
};
|
|
4739
|
-
var arraySum = function arraySum(array, index) {
|
|
4510
|
+
var isLeapYear = year => year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
4511
|
+
var arraySum = (array, index) => {
|
|
4740
4512
|
var sum = 0;
|
|
4741
4513
|
for (var i = 0; i <= index; sum += array[i++]) {
|
|
4742
4514
|
// no-op
|
|
@@ -4745,7 +4517,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4745
4517
|
};
|
|
4746
4518
|
var MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4747
4519
|
var MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4748
|
-
var addDays =
|
|
4520
|
+
var addDays = (date, days) => {
|
|
4749
4521
|
var newDate = new Date(date.getTime());
|
|
4750
4522
|
while (days > 0) {
|
|
4751
4523
|
var leap = isLeapYear(newDate.getFullYear());
|
|
@@ -4778,11 +4550,11 @@ var WebRendererWasmFactory = function () {
|
|
|
4778
4550
|
if (dontAddNull) u8array.length = numBytesWritten;
|
|
4779
4551
|
return u8array;
|
|
4780
4552
|
}
|
|
4781
|
-
var writeArrayToMemory =
|
|
4553
|
+
var writeArrayToMemory = (array, buffer) => {
|
|
4782
4554
|
assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)');
|
|
4783
4555
|
HEAP8.set(array, buffer);
|
|
4784
4556
|
};
|
|
4785
|
-
var _strftime =
|
|
4557
|
+
var _strftime = (s, maxsize, format, tm) => {
|
|
4786
4558
|
// size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);
|
|
4787
4559
|
// http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
|
|
4788
4560
|
|
|
@@ -4929,29 +4701,17 @@ var WebRendererWasmFactory = function () {
|
|
|
4929
4701
|
return thisDate.getFullYear() - 1;
|
|
4930
4702
|
}
|
|
4931
4703
|
var EXPANSION_RULES_2 = {
|
|
4932
|
-
'%a':
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
'%
|
|
4936
|
-
|
|
4937
|
-
},
|
|
4938
|
-
'%b': function b(date) {
|
|
4939
|
-
return MONTHS[date.tm_mon].substring(0, 3);
|
|
4940
|
-
},
|
|
4941
|
-
'%B': function B(date) {
|
|
4942
|
-
return MONTHS[date.tm_mon];
|
|
4943
|
-
},
|
|
4944
|
-
'%C': function C(date) {
|
|
4704
|
+
'%a': date => WEEKDAYS[date.tm_wday].substring(0, 3),
|
|
4705
|
+
'%A': date => WEEKDAYS[date.tm_wday],
|
|
4706
|
+
'%b': date => MONTHS[date.tm_mon].substring(0, 3),
|
|
4707
|
+
'%B': date => MONTHS[date.tm_mon],
|
|
4708
|
+
'%C': date => {
|
|
4945
4709
|
var year = date.tm_year + 1900;
|
|
4946
4710
|
return leadingNulls(year / 100 | 0, 2);
|
|
4947
4711
|
},
|
|
4948
|
-
'%d':
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
'%e': function e(date) {
|
|
4952
|
-
return leadingSomething(date.tm_mday, 2, ' ');
|
|
4953
|
-
},
|
|
4954
|
-
'%g': function g(date) {
|
|
4712
|
+
'%d': date => leadingNulls(date.tm_mday, 2),
|
|
4713
|
+
'%e': date => leadingSomething(date.tm_mday, 2, ' '),
|
|
4714
|
+
'%g': date => {
|
|
4955
4715
|
// %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year.
|
|
4956
4716
|
// In this system, weeks begin on a Monday and week 1 of the year is the week that includes
|
|
4957
4717
|
// January 4th, which is also the week that includes the first Thursday of the year, and
|
|
@@ -4965,47 +4725,33 @@ var WebRendererWasmFactory = function () {
|
|
|
4965
4725
|
return getWeekBasedYear(date).toString().substring(2);
|
|
4966
4726
|
},
|
|
4967
4727
|
'%G': getWeekBasedYear,
|
|
4968
|
-
'%H':
|
|
4969
|
-
|
|
4970
|
-
},
|
|
4971
|
-
'%I': function I(date) {
|
|
4728
|
+
'%H': date => leadingNulls(date.tm_hour, 2),
|
|
4729
|
+
'%I': date => {
|
|
4972
4730
|
var twelveHour = date.tm_hour;
|
|
4973
4731
|
if (twelveHour == 0) twelveHour = 12;else if (twelveHour > 12) twelveHour -= 12;
|
|
4974
4732
|
return leadingNulls(twelveHour, 2);
|
|
4975
4733
|
},
|
|
4976
|
-
'%j':
|
|
4734
|
+
'%j': date => {
|
|
4977
4735
|
// Day of the year (001-366)
|
|
4978
4736
|
return leadingNulls(date.tm_mday + arraySum(isLeapYear(date.tm_year + 1900) ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR, date.tm_mon - 1), 3);
|
|
4979
4737
|
},
|
|
4980
|
-
'%m':
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
'%
|
|
4984
|
-
return leadingNulls(date.tm_min, 2);
|
|
4985
|
-
},
|
|
4986
|
-
'%n': function n() {
|
|
4987
|
-
return '\n';
|
|
4988
|
-
},
|
|
4989
|
-
'%p': function p(date) {
|
|
4738
|
+
'%m': date => leadingNulls(date.tm_mon + 1, 2),
|
|
4739
|
+
'%M': date => leadingNulls(date.tm_min, 2),
|
|
4740
|
+
'%n': () => '\n',
|
|
4741
|
+
'%p': date => {
|
|
4990
4742
|
if (date.tm_hour >= 0 && date.tm_hour < 12) {
|
|
4991
4743
|
return 'AM';
|
|
4992
4744
|
}
|
|
4993
4745
|
return 'PM';
|
|
4994
4746
|
},
|
|
4995
|
-
'%S':
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
'%
|
|
4999
|
-
return '\t';
|
|
5000
|
-
},
|
|
5001
|
-
'%u': function u(date) {
|
|
5002
|
-
return date.tm_wday || 7;
|
|
5003
|
-
},
|
|
5004
|
-
'%U': function U(date) {
|
|
4747
|
+
'%S': date => leadingNulls(date.tm_sec, 2),
|
|
4748
|
+
'%t': () => '\t',
|
|
4749
|
+
'%u': date => date.tm_wday || 7,
|
|
4750
|
+
'%U': date => {
|
|
5005
4751
|
var days = date.tm_yday + 7 - date.tm_wday;
|
|
5006
4752
|
return leadingNulls(Math.floor(days / 7), 2);
|
|
5007
4753
|
},
|
|
5008
|
-
'%V':
|
|
4754
|
+
'%V': date => {
|
|
5009
4755
|
// Replaced by the week number of the year (Monday as the first day of the week)
|
|
5010
4756
|
// as a decimal number [01,53]. If the week containing 1 January has four
|
|
5011
4757
|
// or more days in the new year, then it is considered week 1.
|
|
@@ -5033,22 +4779,18 @@ var WebRendererWasmFactory = function () {
|
|
|
5033
4779
|
}
|
|
5034
4780
|
return leadingNulls(val, 2);
|
|
5035
4781
|
},
|
|
5036
|
-
'%w':
|
|
5037
|
-
|
|
5038
|
-
},
|
|
5039
|
-
'%W': function W(date) {
|
|
4782
|
+
'%w': date => date.tm_wday,
|
|
4783
|
+
'%W': date => {
|
|
5040
4784
|
var days = date.tm_yday + 7 - (date.tm_wday + 6) % 7;
|
|
5041
4785
|
return leadingNulls(Math.floor(days / 7), 2);
|
|
5042
4786
|
},
|
|
5043
|
-
'%y':
|
|
4787
|
+
'%y': date => {
|
|
5044
4788
|
// Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]
|
|
5045
4789
|
return (date.tm_year + 1900).toString().substring(2);
|
|
5046
4790
|
},
|
|
5047
4791
|
// Replaced by the year as a decimal number (for example, 1997). [ tm_year]
|
|
5048
|
-
'%Y':
|
|
5049
|
-
|
|
5050
|
-
},
|
|
5051
|
-
'%z': function z(date) {
|
|
4792
|
+
'%Y': date => date.tm_year + 1900,
|
|
4793
|
+
'%z': date => {
|
|
5052
4794
|
// Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ).
|
|
5053
4795
|
// For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich).
|
|
5054
4796
|
var off = date.tm_gmtoff;
|
|
@@ -5058,12 +4800,8 @@ var WebRendererWasmFactory = function () {
|
|
|
5058
4800
|
off = off / 60 * 100 + off % 60;
|
|
5059
4801
|
return (ahead ? '+' : '-') + String("0000" + off).slice(-4);
|
|
5060
4802
|
},
|
|
5061
|
-
'%Z':
|
|
5062
|
-
|
|
5063
|
-
},
|
|
5064
|
-
'%%': function _() {
|
|
5065
|
-
return '%';
|
|
5066
|
-
}
|
|
4803
|
+
'%Z': date => date.tm_zone,
|
|
4804
|
+
'%%': () => '%'
|
|
5067
4805
|
};
|
|
5068
4806
|
|
|
5069
4807
|
// Replace %% with a pair of NULLs (which cannot occur in a C string), then
|
|
@@ -5082,32 +4820,22 @@ var WebRendererWasmFactory = function () {
|
|
|
5082
4820
|
writeArrayToMemory(bytes, s);
|
|
5083
4821
|
return bytes.length - 1;
|
|
5084
4822
|
};
|
|
5085
|
-
var _strftime_l =
|
|
4823
|
+
var _strftime_l = (s, maxsize, format, tm, loc) => {
|
|
5086
4824
|
return _strftime(s, maxsize, format, tm); // no locale support yet
|
|
5087
4825
|
};
|
|
5088
|
-
InternalError = Module['InternalError'] =
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
return _this2;
|
|
5095
|
-
}
|
|
5096
|
-
_inherits(InternalError, _Error);
|
|
5097
|
-
return _createClass(InternalError);
|
|
5098
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
4826
|
+
InternalError = Module['InternalError'] = class InternalError extends Error {
|
|
4827
|
+
constructor(message) {
|
|
4828
|
+
super(message);
|
|
4829
|
+
this.name = 'InternalError';
|
|
4830
|
+
}
|
|
4831
|
+
};
|
|
5099
4832
|
embind_init_charCodes();
|
|
5100
|
-
BindingError = Module['BindingError'] =
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
return _this3;
|
|
5107
|
-
}
|
|
5108
|
-
_inherits(BindingError, _Error2);
|
|
5109
|
-
return _createClass(BindingError);
|
|
5110
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
4833
|
+
BindingError = Module['BindingError'] = class BindingError extends Error {
|
|
4834
|
+
constructor(message) {
|
|
4835
|
+
super(message);
|
|
4836
|
+
this.name = 'BindingError';
|
|
4837
|
+
}
|
|
4838
|
+
};
|
|
5111
4839
|
init_ClassHandle();
|
|
5112
4840
|
init_embind();
|
|
5113
4841
|
init_RegisteredPointer();
|
|
@@ -5557,33 +5285,33 @@ var WebRendererWasmFactory = function () {
|
|
|
5557
5285
|
/** @export */
|
|
5558
5286
|
glWaitSync: _glWaitSync,
|
|
5559
5287
|
/** @export */
|
|
5560
|
-
invoke_ii
|
|
5288
|
+
invoke_ii,
|
|
5561
5289
|
/** @export */
|
|
5562
|
-
invoke_iii
|
|
5290
|
+
invoke_iii,
|
|
5563
5291
|
/** @export */
|
|
5564
|
-
invoke_iiii
|
|
5292
|
+
invoke_iiii,
|
|
5565
5293
|
/** @export */
|
|
5566
|
-
invoke_iiiii
|
|
5294
|
+
invoke_iiiii,
|
|
5567
5295
|
/** @export */
|
|
5568
|
-
invoke_iiiiii
|
|
5296
|
+
invoke_iiiiii,
|
|
5569
5297
|
/** @export */
|
|
5570
|
-
invoke_iiiiiii
|
|
5298
|
+
invoke_iiiiiii,
|
|
5571
5299
|
/** @export */
|
|
5572
|
-
invoke_v
|
|
5300
|
+
invoke_v,
|
|
5573
5301
|
/** @export */
|
|
5574
|
-
invoke_vi
|
|
5302
|
+
invoke_vi,
|
|
5575
5303
|
/** @export */
|
|
5576
|
-
invoke_vii
|
|
5304
|
+
invoke_vii,
|
|
5577
5305
|
/** @export */
|
|
5578
|
-
invoke_viii
|
|
5306
|
+
invoke_viii,
|
|
5579
5307
|
/** @export */
|
|
5580
|
-
invoke_viiii
|
|
5308
|
+
invoke_viiii,
|
|
5581
5309
|
/** @export */
|
|
5582
|
-
invoke_viiiii
|
|
5310
|
+
invoke_viiiii,
|
|
5583
5311
|
/** @export */
|
|
5584
|
-
invoke_viiiiii
|
|
5312
|
+
invoke_viiiiii,
|
|
5585
5313
|
/** @export */
|
|
5586
|
-
invoke_viiiiiiiii
|
|
5314
|
+
invoke_viiiiiiiii,
|
|
5587
5315
|
/** @export */
|
|
5588
5316
|
strftime_l: _strftime_l
|
|
5589
5317
|
};
|
|
@@ -5593,18 +5321,10 @@ var WebRendererWasmFactory = function () {
|
|
|
5593
5321
|
var _free = Module['_free'] = createExportWrapper('free', 1);
|
|
5594
5322
|
var _fflush = createExportWrapper('fflush', 1);
|
|
5595
5323
|
var _setThrew = createExportWrapper('setThrew', 2);
|
|
5596
|
-
var
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
var
|
|
5600
|
-
return (_emscripten_stack_get_end2 = wasmExports['emscripten_stack_get_end'])();
|
|
5601
|
-
};
|
|
5602
|
-
var _emscripten_stack_restore = function __emscripten_stack_restore(a0) {
|
|
5603
|
-
return (_emscripten_stack_restore = wasmExports['_emscripten_stack_restore'])(a0);
|
|
5604
|
-
};
|
|
5605
|
-
var _emscripten_stack_get_current2 = function _emscripten_stack_get_current() {
|
|
5606
|
-
return (_emscripten_stack_get_current2 = wasmExports['emscripten_stack_get_current'])();
|
|
5607
|
-
};
|
|
5324
|
+
var _emscripten_stack_init = () => (_emscripten_stack_init = wasmExports['emscripten_stack_init'])();
|
|
5325
|
+
var _emscripten_stack_get_end = () => (_emscripten_stack_get_end = wasmExports['emscripten_stack_get_end'])();
|
|
5326
|
+
var __emscripten_stack_restore = a0 => (__emscripten_stack_restore = wasmExports['_emscripten_stack_restore'])(a0);
|
|
5327
|
+
var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
|
|
5608
5328
|
function invoke_ii(index, a1) {
|
|
5609
5329
|
var sp = stackSave();
|
|
5610
5330
|
try {
|
|
@@ -5764,7 +5484,7 @@ var WebRendererWasmFactory = function () {
|
|
|
5764
5484
|
// This is normally called automatically during __wasm_call_ctors but need to
|
|
5765
5485
|
// get these values before even running any of the ctors so we call it redundantly
|
|
5766
5486
|
// here.
|
|
5767
|
-
|
|
5487
|
+
_emscripten_stack_init();
|
|
5768
5488
|
// TODO(sbc): Move writeStackCookie to native to to avoid this.
|
|
5769
5489
|
writeStackCookie();
|
|
5770
5490
|
}
|
|
@@ -5811,7 +5531,7 @@ var WebRendererWasmFactory = function () {
|
|
|
5811
5531
|
var oldOut = out;
|
|
5812
5532
|
var oldErr = err;
|
|
5813
5533
|
var has = false;
|
|
5814
|
-
out = err =
|
|
5534
|
+
out = err = x => {
|
|
5815
5535
|
has = true;
|
|
5816
5536
|
};
|
|
5817
5537
|
try {
|
|
@@ -5821,8 +5541,8 @@ var WebRendererWasmFactory = function () {
|
|
|
5821
5541
|
out = oldOut;
|
|
5822
5542
|
err = oldErr;
|
|
5823
5543
|
if (has) {
|
|
5824
|
-
|
|
5825
|
-
|
|
5544
|
+
warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.');
|
|
5545
|
+
warnOnce('(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)');
|
|
5826
5546
|
}
|
|
5827
5547
|
}
|
|
5828
5548
|
run();
|
|
@@ -5843,24 +5563,23 @@ var WebRendererWasmFactory = function () {
|
|
|
5843
5563
|
// and assigned properties to it, but now we return a distinct object. This
|
|
5844
5564
|
// keeps the instance private until it is ready (i.e the promise has been
|
|
5845
5565
|
// resolved).
|
|
5846
|
-
var _loop = function _loop() {
|
|
5847
|
-
var prop = _Object$keys[_i];
|
|
5566
|
+
var _loop = function _loop(prop) {
|
|
5848
5567
|
if (!(prop in moduleArg)) {
|
|
5849
5568
|
Object.defineProperty(moduleArg, prop, {
|
|
5850
5569
|
configurable: true,
|
|
5851
|
-
get
|
|
5570
|
+
get() {
|
|
5852
5571
|
abort("Access to module property ('".concat(prop, "') is no longer possible via the module constructor argument; Instead, use the result of the module constructor."));
|
|
5853
5572
|
}
|
|
5854
5573
|
});
|
|
5855
5574
|
}
|
|
5856
5575
|
};
|
|
5857
|
-
for (var
|
|
5858
|
-
_loop();
|
|
5576
|
+
for (var prop of Object.keys(Module)) {
|
|
5577
|
+
_loop(prop);
|
|
5859
5578
|
}
|
|
5860
5579
|
// end include: postamble_modularize.js
|
|
5861
5580
|
|
|
5862
5581
|
return moduleRtn;
|
|
5863
5582
|
};
|
|
5864
|
-
}();
|
|
5583
|
+
})();
|
|
5865
5584
|
|
|
5866
5585
|
export { WebRendererWasmFactory as default };
|