@thenick775/mgba-wasm 2.0.0-beta.2 → 2.0.0-beta.3

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/dist/mgba.js CHANGED
@@ -793,7 +793,7 @@ if (!ENVIRONMENT_IS_PTHREAD) {
793
793
  wasmMemory = Module['wasmMemory'];
794
794
  } else
795
795
  {
796
- var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 134217728;
796
+ var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 268435456;
797
797
 
798
798
  /** @suppress {checkTypes} */
799
799
  wasmMemory = new WebAssembly.Memory({
@@ -1069,32 +1069,32 @@ async function createWasm() {
1069
1069
  // === Body ===
1070
1070
 
1071
1071
  var ASM_CONSTS = {
1072
- 308384: () => { console.error("thread instantiation failed") },
1073
- 308433: ($0, $1) => { Module.canvas.width = $0; Module.canvas.height = $1; },
1074
- 308490: ($0, $1, $2, $3, $4, $5, $6) => { Module.version = { gitCommit : UTF8ToString($0), gitShort : UTF8ToString($1), gitBranch : UTF8ToString($2), gitRevision : $3, binaryName : UTF8ToString($4), projectName : UTF8ToString($5), projectVersion : UTF8ToString($6) }; },
1075
- 308722: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1076
- 308820: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1077
- 308918: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1078
- 309016: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1079
- 309114: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1080
- 309212: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1081
- 309310: () => { FS.syncfs(function (err) { assert(!err); }) },
1082
- 309354: ($0) => { var str = UTF8ToString($0) + '\n\n' + 'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :'; var reply = window.prompt(str, "i"); if (reply === null) { reply = "i"; } return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL); },
1083
- 309579: () => { if (typeof(AudioContext) !== 'undefined') { return true; } else if (typeof(webkitAudioContext) !== 'undefined') { return true; } return false; },
1084
- 309726: () => { if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) { return true; } else if (typeof(navigator.webkitGetUserMedia) !== 'undefined') { return true; } return false; },
1085
- 309960: ($0) => { if(typeof(Module['SDL2']) === 'undefined') { Module['SDL2'] = {}; } var SDL2 = Module['SDL2']; if (!$0) { SDL2.audio = {}; } else { SDL2.capture = {}; } if (!SDL2.audioContext) { if (typeof(AudioContext) !== 'undefined') { SDL2.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) !== 'undefined') { SDL2.audioContext = new webkitAudioContext(); } if (SDL2.audioContext) { if ((typeof navigator.userActivation) === 'undefined') { autoResumeAudioContext(SDL2.audioContext); } } } return SDL2.audioContext === undefined ? -1 : 0; },
1086
- 310512: () => { var SDL2 = Module['SDL2']; return SDL2.audioContext.sampleRate; },
1087
- 310580: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; var have_microphone = function(stream) { if (SDL2.capture.silenceTimer !== undefined) { clearInterval(SDL2.capture.silenceTimer); SDL2.capture.silenceTimer = undefined; SDL2.capture.silenceBuffer = undefined } SDL2.capture.mediaStreamNode = SDL2.audioContext.createMediaStreamSource(stream); SDL2.capture.scriptProcessorNode = SDL2.audioContext.createScriptProcessor($1, $0, 1); SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); SDL2.capture.stream = stream; }; var no_microphone = function(error) { }; SDL2.capture.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); } else if (navigator.webkitGetUserMedia !== undefined) { navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone); } },
1088
- 312273: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0); SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) { if ((SDL2 === undefined) || (SDL2.audio === undefined)) { return; } if (SDL2.audio.silenceTimer !== undefined) { clearInterval(SDL2.audio.silenceTimer); SDL2.audio.silenceTimer = undefined; SDL2.audio.silenceBuffer = undefined; } SDL2.audio.currentOutputBuffer = e['outputBuffer']; dynCall('vi', $2, [$3]); }; SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); if (SDL2.audioContext.state === 'suspended') { SDL2.audio.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); SDL2.audio.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { if ((typeof navigator.userActivation) !== 'undefined') { if (navigator.userActivation.hasBeenActive) { SDL2.audioContext.resume(); } } SDL2.audio.currentOutputBuffer = SDL2.audio.silenceBuffer; dynCall('vi', $2, [$3]); SDL2.audio.currentOutputBuffer = undefined; }; SDL2.audio.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); } },
1089
- 313448: ($0, $1) => { var SDL2 = Module['SDL2']; var numChannels = SDL2.capture.currentCaptureBuffer.numberOfChannels; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.capture.currentCaptureBuffer.getChannelData(c); if (channelData.length != $1) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } if (numChannels == 1) { for (var j = 0; j < $1; ++j) { setValue($0 + (j * 4), channelData[j], 'float'); } } else { for (var j = 0; j < $1; ++j) { setValue($0 + (((j * numChannels) + c) * 4), channelData[j], 'float'); } } } },
1090
- 314053: ($0, $1) => { var SDL2 = Module['SDL2']; var buf = $0 >>> 2; var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c); if (channelData.length != $1) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } for (var j = 0; j < $1; ++j) { channelData[j] = HEAPF32[buf + (j*numChannels + c)]; } } },
1091
- 314542: ($0) => { var SDL2 = Module['SDL2']; if ($0) { if (SDL2.capture.silenceTimer !== undefined) { clearInterval(SDL2.capture.silenceTimer); } if (SDL2.capture.stream !== undefined) { var tracks = SDL2.capture.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { SDL2.capture.stream.removeTrack(tracks[i]); } } if (SDL2.capture.scriptProcessorNode !== undefined) { SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; SDL2.capture.scriptProcessorNode.disconnect(); } if (SDL2.capture.mediaStreamNode !== undefined) { SDL2.capture.mediaStreamNode.disconnect(); } SDL2.capture = undefined; } else { if (SDL2.audio.scriptProcessorNode != undefined) { SDL2.audio.scriptProcessorNode.disconnect(); } if (SDL2.audio.silenceTimer !== undefined) { clearInterval(SDL2.audio.silenceTimer); } SDL2.audio = undefined; } if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) { SDL2.audioContext.close(); SDL2.audioContext = undefined; } },
1092
- 315548: ($0, $1, $2) => { var w = $0; var h = $1; var pixels = $2; if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; if (SDL2.ctxCanvas !== Module['canvas']) { SDL2.ctx = Module['createContext'](Module['canvas'], false, true); SDL2.ctxCanvas = Module['canvas']; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { SDL2.image = SDL2.ctx.createImageData(w, h); SDL2.w = w; SDL2.h = h; SDL2.imageCtx = SDL2.ctx; } var data = SDL2.image.data; var src = pixels / 4; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = 0xff; src++; dst += 4; } } else { if (SDL2.data32Data !== data) { SDL2.data32 = new Int32Array(data.buffer); SDL2.data8 = new Uint8Array(data.buffer); SDL2.data32Data = data; } var data32 = SDL2.data32; num = data32.length; data32.set(HEAP32.subarray(src, src + num)); var data8 = SDL2.data8; var i = 3; var j = i + 4*num; if (num % 8 == 0) { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; } } else { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; } } } SDL2.ctx.putImageData(SDL2.image, 0, 0); },
1093
- 317016: ($0, $1, $2, $3, $4) => { var w = $0; var h = $1; var hot_x = $2; var hot_y = $3; var pixels = $4; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; var ctx = canvas.getContext("2d"); var image = ctx.createImageData(w, h); var data = image.data; var src = pixels / 4; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = (val >> 24) & 0xff; src++; dst += 4; } } else { var data32 = new Int32Array(data.buffer); num = data32.length; data32.set(HEAP32.subarray(src, src + num)); } ctx.putImageData(image, 0, 0); var url = hot_x === 0 && hot_y === 0 ? "url(" + canvas.toDataURL() + "), auto" : "url(" + canvas.toDataURL() + ") " + hot_x + " " + hot_y + ", auto"; var urlBuf = _malloc(url.length + 1); stringToUTF8(url, urlBuf, url.length + 1); return urlBuf; },
1094
- 318004: ($0) => { if (Module['canvas']) { Module['canvas'].style['cursor'] = UTF8ToString($0); } },
1095
- 318087: () => { if (Module['canvas']) { Module['canvas'].style['cursor'] = 'none'; } },
1096
- 318156: () => { return window.innerWidth; },
1097
- 318186: () => { return window.innerHeight; }
1072
+ 310256: () => { console.error("thread instantiation failed") },
1073
+ 310305: ($0, $1) => { Module.canvas.width = $0; Module.canvas.height = $1; },
1074
+ 310362: ($0, $1, $2, $3, $4, $5, $6) => { Module.version = { gitCommit : UTF8ToString($0), gitShort : UTF8ToString($1), gitBranch : UTF8ToString($2), gitRevision : $3, binaryName : UTF8ToString($4), projectName : UTF8ToString($5), projectVersion : UTF8ToString($6) }; },
1075
+ 310594: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1076
+ 310692: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1077
+ 310790: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1078
+ 310888: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1079
+ 310986: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1080
+ 311084: ($0, $1) => { const funcPtr = $0; const ctx = $1; const func = wasmTable.get(funcPtr); if (func) func(ctx); },
1081
+ 311182: () => { FS.syncfs(function (err) { assert(!err); }) },
1082
+ 311226: ($0) => { var str = UTF8ToString($0) + '\n\n' + 'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :'; var reply = window.prompt(str, "i"); if (reply === null) { reply = "i"; } return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL); },
1083
+ 311451: () => { if (typeof(AudioContext) !== 'undefined') { return true; } else if (typeof(webkitAudioContext) !== 'undefined') { return true; } return false; },
1084
+ 311598: () => { if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) { return true; } else if (typeof(navigator.webkitGetUserMedia) !== 'undefined') { return true; } return false; },
1085
+ 311832: ($0) => { if(typeof(Module['SDL2']) === 'undefined') { Module['SDL2'] = {}; } var SDL2 = Module['SDL2']; if (!$0) { SDL2.audio = {}; } else { SDL2.capture = {}; } if (!SDL2.audioContext) { if (typeof(AudioContext) !== 'undefined') { SDL2.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) !== 'undefined') { SDL2.audioContext = new webkitAudioContext(); } if (SDL2.audioContext) { if ((typeof navigator.userActivation) === 'undefined') { autoResumeAudioContext(SDL2.audioContext); } } } return SDL2.audioContext === undefined ? -1 : 0; },
1086
+ 312384: () => { var SDL2 = Module['SDL2']; return SDL2.audioContext.sampleRate; },
1087
+ 312452: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; var have_microphone = function(stream) { if (SDL2.capture.silenceTimer !== undefined) { clearInterval(SDL2.capture.silenceTimer); SDL2.capture.silenceTimer = undefined; SDL2.capture.silenceBuffer = undefined } SDL2.capture.mediaStreamNode = SDL2.audioContext.createMediaStreamSource(stream); SDL2.capture.scriptProcessorNode = SDL2.audioContext.createScriptProcessor($1, $0, 1); SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); SDL2.capture.stream = stream; }; var no_microphone = function(error) { }; SDL2.capture.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); } else if (navigator.webkitGetUserMedia !== undefined) { navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone); } },
1088
+ 314145: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0); SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) { if ((SDL2 === undefined) || (SDL2.audio === undefined)) { return; } if (SDL2.audio.silenceTimer !== undefined) { clearInterval(SDL2.audio.silenceTimer); SDL2.audio.silenceTimer = undefined; SDL2.audio.silenceBuffer = undefined; } SDL2.audio.currentOutputBuffer = e['outputBuffer']; dynCall('vi', $2, [$3]); }; SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); if (SDL2.audioContext.state === 'suspended') { SDL2.audio.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); SDL2.audio.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { if ((typeof navigator.userActivation) !== 'undefined') { if (navigator.userActivation.hasBeenActive) { SDL2.audioContext.resume(); } } SDL2.audio.currentOutputBuffer = SDL2.audio.silenceBuffer; dynCall('vi', $2, [$3]); SDL2.audio.currentOutputBuffer = undefined; }; SDL2.audio.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); } },
1089
+ 315320: ($0, $1) => { var SDL2 = Module['SDL2']; var numChannels = SDL2.capture.currentCaptureBuffer.numberOfChannels; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.capture.currentCaptureBuffer.getChannelData(c); if (channelData.length != $1) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } if (numChannels == 1) { for (var j = 0; j < $1; ++j) { setValue($0 + (j * 4), channelData[j], 'float'); } } else { for (var j = 0; j < $1; ++j) { setValue($0 + (((j * numChannels) + c) * 4), channelData[j], 'float'); } } } },
1090
+ 315925: ($0, $1) => { var SDL2 = Module['SDL2']; var buf = $0 >>> 2; var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c); if (channelData.length != $1) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } for (var j = 0; j < $1; ++j) { channelData[j] = HEAPF32[buf + (j*numChannels + c)]; } } },
1091
+ 316414: ($0) => { var SDL2 = Module['SDL2']; if ($0) { if (SDL2.capture.silenceTimer !== undefined) { clearInterval(SDL2.capture.silenceTimer); } if (SDL2.capture.stream !== undefined) { var tracks = SDL2.capture.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { SDL2.capture.stream.removeTrack(tracks[i]); } } if (SDL2.capture.scriptProcessorNode !== undefined) { SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; SDL2.capture.scriptProcessorNode.disconnect(); } if (SDL2.capture.mediaStreamNode !== undefined) { SDL2.capture.mediaStreamNode.disconnect(); } SDL2.capture = undefined; } else { if (SDL2.audio.scriptProcessorNode != undefined) { SDL2.audio.scriptProcessorNode.disconnect(); } if (SDL2.audio.silenceTimer !== undefined) { clearInterval(SDL2.audio.silenceTimer); } SDL2.audio = undefined; } if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) { SDL2.audioContext.close(); SDL2.audioContext = undefined; } },
1092
+ 317420: ($0, $1, $2) => { var w = $0; var h = $1; var pixels = $2; if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; if (SDL2.ctxCanvas !== Module['canvas']) { SDL2.ctx = Module['createContext'](Module['canvas'], false, true); SDL2.ctxCanvas = Module['canvas']; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { SDL2.image = SDL2.ctx.createImageData(w, h); SDL2.w = w; SDL2.h = h; SDL2.imageCtx = SDL2.ctx; } var data = SDL2.image.data; var src = pixels / 4; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = 0xff; src++; dst += 4; } } else { if (SDL2.data32Data !== data) { SDL2.data32 = new Int32Array(data.buffer); SDL2.data8 = new Uint8Array(data.buffer); SDL2.data32Data = data; } var data32 = SDL2.data32; num = data32.length; data32.set(HEAP32.subarray(src, src + num)); var data8 = SDL2.data8; var i = 3; var j = i + 4*num; if (num % 8 == 0) { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; } } else { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; } } } SDL2.ctx.putImageData(SDL2.image, 0, 0); },
1093
+ 318888: ($0, $1, $2, $3, $4) => { var w = $0; var h = $1; var hot_x = $2; var hot_y = $3; var pixels = $4; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; var ctx = canvas.getContext("2d"); var image = ctx.createImageData(w, h); var data = image.data; var src = pixels / 4; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = (val >> 24) & 0xff; src++; dst += 4; } } else { var data32 = new Int32Array(data.buffer); num = data32.length; data32.set(HEAP32.subarray(src, src + num)); } ctx.putImageData(image, 0, 0); var url = hot_x === 0 && hot_y === 0 ? "url(" + canvas.toDataURL() + "), auto" : "url(" + canvas.toDataURL() + ") " + hot_x + " " + hot_y + ", auto"; var urlBuf = _malloc(url.length + 1); stringToUTF8(url, urlBuf, url.length + 1); return urlBuf; },
1094
+ 319876: ($0) => { if (Module['canvas']) { Module['canvas'].style['cursor'] = UTF8ToString($0); } },
1095
+ 319959: () => { if (Module['canvas']) { Module['canvas'].style['cursor'] = 'none'; } },
1096
+ 320028: () => { return window.innerWidth; },
1097
+ 320058: () => { return window.innerHeight; }
1098
1098
  };
1099
1099
 
1100
1100
  // end include: preamble.js
@@ -5680,7 +5680,7 @@ var ASM_CONSTS = {
5680
5680
  var contextAttributes = {
5681
5681
  antialias: false,
5682
5682
  alpha: false,
5683
- majorVersion: 1,
5683
+ majorVersion: 2,
5684
5684
  };
5685
5685
 
5686
5686
  if (webGLContextAttributes) {
@@ -6113,39 +6113,13 @@ var ASM_CONSTS = {
6113
6113
 
6114
6114
 
6115
6115
 
6116
- var webgl_enable_ANGLE_instanced_arrays = (ctx) => {
6117
- // Extension available in WebGL 1 from Firefox 26 and Google Chrome 30 onwards. Core feature in WebGL 2.
6118
- var ext = ctx.getExtension('ANGLE_instanced_arrays');
6119
- // Because this extension is a core function in WebGL 2, assign the extension entry points in place of
6120
- // where the core functions will reside in WebGL 2. This way the calling code can call these without
6121
- // having to dynamically branch depending if running against WebGL 1 or WebGL 2.
6122
- if (ext) {
6123
- ctx['vertexAttribDivisor'] = (index, divisor) => ext['vertexAttribDivisorANGLE'](index, divisor);
6124
- ctx['drawArraysInstanced'] = (mode, first, count, primcount) => ext['drawArraysInstancedANGLE'](mode, first, count, primcount);
6125
- ctx['drawElementsInstanced'] = (mode, count, type, indices, primcount) => ext['drawElementsInstancedANGLE'](mode, count, type, indices, primcount);
6126
- return 1;
6127
- }
6128
- };
6129
-
6130
- var webgl_enable_OES_vertex_array_object = (ctx) => {
6131
- // Extension available in WebGL 1 from Firefox 25 and WebKit 536.28/desktop Safari 6.0.3 onwards. Core feature in WebGL 2.
6132
- var ext = ctx.getExtension('OES_vertex_array_object');
6133
- if (ext) {
6134
- ctx['createVertexArray'] = () => ext['createVertexArrayOES']();
6135
- ctx['deleteVertexArray'] = (vao) => ext['deleteVertexArrayOES'](vao);
6136
- ctx['bindVertexArray'] = (vao) => ext['bindVertexArrayOES'](vao);
6137
- ctx['isVertexArray'] = (vao) => ext['isVertexArrayOES'](vao);
6138
- return 1;
6139
- }
6140
- };
6116
+ var webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance = (ctx) =>
6117
+ // Closure is expected to be allowed to minify the '.dibvbi' property, so not accessing it quoted.
6118
+ !!(ctx.dibvbi = ctx.getExtension('WEBGL_draw_instanced_base_vertex_base_instance'));
6141
6119
 
6142
- var webgl_enable_WEBGL_draw_buffers = (ctx) => {
6143
- // Extension available in WebGL 1 from Firefox 28 onwards. Core feature in WebGL 2.
6144
- var ext = ctx.getExtension('WEBGL_draw_buffers');
6145
- if (ext) {
6146
- ctx['drawBuffers'] = (n, bufs) => ext['drawBuffersWEBGL'](n, bufs);
6147
- return 1;
6148
- }
6120
+ var webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance = (ctx) => {
6121
+ // Closure is expected to be allowed to minify the '.mdibvbi' property, so not accessing it quoted.
6122
+ return !!(ctx.mdibvbi = ctx.getExtension('WEBGL_multi_draw_instanced_base_vertex_base_instance'));
6149
6123
  };
6150
6124
 
6151
6125
  var webgl_enable_EXT_polygon_offset_clamp = (ctx) =>
@@ -6165,23 +6139,13 @@ var ASM_CONSTS = {
6165
6139
  // Restrict the list of advertised extensions to those that we actually
6166
6140
  // support.
6167
6141
  var supportedExtensions = [
6168
- // WebGL 1 extensions
6169
- 'ANGLE_instanced_arrays',
6170
- 'EXT_blend_minmax',
6171
- 'EXT_disjoint_timer_query',
6172
- 'EXT_frag_depth',
6173
- 'EXT_shader_texture_lod',
6174
- 'EXT_sRGB',
6175
- 'OES_element_index_uint',
6176
- 'OES_fbo_render_mipmap',
6177
- 'OES_standard_derivatives',
6178
- 'OES_texture_float',
6179
- 'OES_texture_half_float',
6180
- 'OES_texture_half_float_linear',
6181
- 'OES_vertex_array_object',
6182
- 'WEBGL_color_buffer_float',
6183
- 'WEBGL_depth_texture',
6184
- 'WEBGL_draw_buffers',
6142
+ // WebGL 2 extensions
6143
+ 'EXT_color_buffer_float',
6144
+ 'EXT_conservative_depth',
6145
+ 'EXT_disjoint_timer_query_webgl2',
6146
+ 'EXT_texture_norm16',
6147
+ 'NV_shader_noperspective_interpolation',
6148
+ 'WEBGL_clip_cull_distance',
6185
6149
  // WebGL 1 and WebGL 2 extensions
6186
6150
  'EXT_clip_control',
6187
6151
  'EXT_color_buffer_half_float',
@@ -6224,8 +6188,13 @@ var ASM_CONSTS = {
6224
6188
  offscreenCanvases:{
6225
6189
  },
6226
6190
  queries:[],
6191
+ samplers:[],
6192
+ transformFeedbacks:[],
6193
+ syncs:[],
6227
6194
  stringCache:{
6228
6195
  },
6196
+ stringiCache:{
6197
+ },
6229
6198
  unpackAlignment:4,
6230
6199
  unpackRowLength:0,
6231
6200
  recordError:(errorCode) => {
@@ -6283,8 +6252,7 @@ var ASM_CONSTS = {
6283
6252
  canvas.getContext = fixedGetContext;
6284
6253
  }
6285
6254
 
6286
- var ctx =
6287
- canvas.getContext("webgl", webGLContextAttributes);
6255
+ var ctx = canvas.getContext("webgl2", webGLContextAttributes);
6288
6256
 
6289
6257
  if (!ctx) return 0;
6290
6258
 
@@ -6361,11 +6329,21 @@ var ASM_CONSTS = {
6361
6329
  webgl_enable_EXT_polygon_offset_clamp(GLctx);
6362
6330
  webgl_enable_EXT_clip_control(GLctx);
6363
6331
  webgl_enable_WEBGL_polygon_mode(GLctx);
6364
- // Extensions that are only available in WebGL 1 (the calls will be no-ops
6365
- // if called on a WebGL 2 context active)
6366
- webgl_enable_ANGLE_instanced_arrays(GLctx);
6367
- webgl_enable_OES_vertex_array_object(GLctx);
6368
- webgl_enable_WEBGL_draw_buffers(GLctx);
6332
+ // Extensions that are available from WebGL >= 2 (no-op if called on a WebGL 1 context active)
6333
+ webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance(GLctx);
6334
+ webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance(GLctx);
6335
+
6336
+ // On WebGL 2, EXT_disjoint_timer_query is replaced with an alternative
6337
+ // that's based on core APIs, and exposes only the queryCounterEXT()
6338
+ // entrypoint.
6339
+ if (context.version >= 2) {
6340
+ GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query_webgl2");
6341
+ }
6342
+
6343
+ // However, Firefox exposes the WebGL 1 version on WebGL 2 as well and
6344
+ // thus we look for the WebGL 1 version again if the WebGL 2 version
6345
+ // isn't present. https://bugzilla.mozilla.org/show_bug.cgi?id=1328882
6346
+ if (context.version < 2 || !GLctx.disjointTimerQueryExt)
6369
6347
  {
6370
6348
  GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");
6371
6349
  }
@@ -6408,7 +6386,7 @@ var ASM_CONSTS = {
6408
6386
  }
6409
6387
  contextAttribs += 8;
6410
6388
  }
6411
- if (glesContextVersion != 2) {
6389
+ if (glesContextVersion < 2 || glesContextVersion > 3) {
6412
6390
  EGL.setErrorCode(0x3005 /* EGL_BAD_CONFIG */);
6413
6391
  return 0; /* EGL_NO_CONTEXT */
6414
6392
  }
@@ -7786,12 +7764,22 @@ var ASM_CONSTS = {
7786
7764
  };
7787
7765
  var _emscripten_glAttachShader = _glAttachShader;
7788
7766
 
7767
+ /** @suppress {duplicate } */
7768
+ var _glBeginQuery = (target, id) => {
7769
+ GLctx.beginQuery(target, GL.queries[id]);
7770
+ };
7771
+ var _emscripten_glBeginQuery = _glBeginQuery;
7772
+
7789
7773
  /** @suppress {duplicate } */
7790
7774
  var _glBeginQueryEXT = (target, id) => {
7791
7775
  GLctx.disjointTimerQueryExt['beginQueryEXT'](target, GL.queries[id]);
7792
7776
  };
7793
7777
  var _emscripten_glBeginQueryEXT = _glBeginQueryEXT;
7794
7778
 
7779
+ /** @suppress {duplicate } */
7780
+ var _glBeginTransformFeedback = (x0) => GLctx.beginTransformFeedback(x0);
7781
+ var _emscripten_glBeginTransformFeedback = _glBeginTransformFeedback;
7782
+
7795
7783
 
7796
7784
  /** @suppress {duplicate } */
7797
7785
  var _glBindAttribLocation = (program, index, name) => {
@@ -7802,10 +7790,37 @@ var ASM_CONSTS = {
7802
7790
  /** @suppress {duplicate } */
7803
7791
  var _glBindBuffer = (target, buffer) => {
7804
7792
 
7793
+ if (target == 0x88EB /*GL_PIXEL_PACK_BUFFER*/) {
7794
+ // In WebGL 2 glReadPixels entry point, we need to use a different WebGL 2
7795
+ // API function call when a buffer is bound to
7796
+ // GL_PIXEL_PACK_BUFFER_BINDING point, so must keep track whether that
7797
+ // binding point is non-null to know what is the proper API function to
7798
+ // call.
7799
+ GLctx.currentPixelPackBufferBinding = buffer;
7800
+ } else if (target == 0x88EC /*GL_PIXEL_UNPACK_BUFFER*/) {
7801
+ // In WebGL 2 gl(Compressed)Tex(Sub)Image[23]D entry points, we need to
7802
+ // use a different WebGL 2 API function call when a buffer is bound to
7803
+ // GL_PIXEL_UNPACK_BUFFER_BINDING point, so must keep track whether that
7804
+ // binding point is non-null to know what is the proper API function to
7805
+ // call.
7806
+ GLctx.currentPixelUnpackBufferBinding = buffer;
7807
+ }
7805
7808
  GLctx.bindBuffer(target, GL.buffers[buffer]);
7806
7809
  };
7807
7810
  var _emscripten_glBindBuffer = _glBindBuffer;
7808
7811
 
7812
+ /** @suppress {duplicate } */
7813
+ var _glBindBufferBase = (target, index, buffer) => {
7814
+ GLctx.bindBufferBase(target, index, GL.buffers[buffer]);
7815
+ };
7816
+ var _emscripten_glBindBufferBase = _glBindBufferBase;
7817
+
7818
+ /** @suppress {duplicate } */
7819
+ var _glBindBufferRange = (target, index, buffer, offset, ptrsize) => {
7820
+ GLctx.bindBufferRange(target, index, GL.buffers[buffer], offset, ptrsize);
7821
+ };
7822
+ var _emscripten_glBindBufferRange = _glBindBufferRange;
7823
+
7809
7824
  /** @suppress {duplicate } */
7810
7825
  var _glBindFramebuffer = (target, framebuffer) => {
7811
7826
 
@@ -7820,17 +7835,31 @@ var ASM_CONSTS = {
7820
7835
  };
7821
7836
  var _emscripten_glBindRenderbuffer = _glBindRenderbuffer;
7822
7837
 
7838
+ /** @suppress {duplicate } */
7839
+ var _glBindSampler = (unit, sampler) => {
7840
+ GLctx.bindSampler(unit, GL.samplers[sampler]);
7841
+ };
7842
+ var _emscripten_glBindSampler = _glBindSampler;
7843
+
7823
7844
  /** @suppress {duplicate } */
7824
7845
  var _glBindTexture = (target, texture) => {
7825
7846
  GLctx.bindTexture(target, GL.textures[texture]);
7826
7847
  };
7827
7848
  var _emscripten_glBindTexture = _glBindTexture;
7828
7849
 
7829
-
7850
+ /** @suppress {duplicate } */
7851
+ var _glBindTransformFeedback = (target, id) => {
7852
+ GLctx.bindTransformFeedback(target, GL.transformFeedbacks[id]);
7853
+ };
7854
+ var _emscripten_glBindTransformFeedback = _glBindTransformFeedback;
7855
+
7830
7856
  /** @suppress {duplicate } */
7831
7857
  var _glBindVertexArray = (vao) => {
7832
7858
  GLctx.bindVertexArray(GL.vaos[vao]);
7833
7859
  };
7860
+ var _emscripten_glBindVertexArray = _glBindVertexArray;
7861
+
7862
+
7834
7863
  /** @suppress {duplicate } */
7835
7864
  var _glBindVertexArrayOES = _glBindVertexArray;
7836
7865
  var _emscripten_glBindVertexArrayOES = _glBindVertexArrayOES;
@@ -7855,20 +7884,34 @@ var ASM_CONSTS = {
7855
7884
  var _glBlendFuncSeparate = (x0, x1, x2, x3) => GLctx.blendFuncSeparate(x0, x1, x2, x3);
7856
7885
  var _emscripten_glBlendFuncSeparate = _glBlendFuncSeparate;
7857
7886
 
7887
+ /** @suppress {duplicate } */
7888
+ var _glBlitFramebuffer = (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) => GLctx.blitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
7889
+ var _emscripten_glBlitFramebuffer = _glBlitFramebuffer;
7890
+
7858
7891
  /** @suppress {duplicate } */
7859
7892
  var _glBufferData = (target, size, data, usage) => {
7860
7893
 
7861
- // N.b. here first form specifies a heap subarray, second form an integer
7862
- // size, so the ?: code here is polymorphic. It is advised to avoid
7863
- // randomly mixing both uses in calling code, to avoid any potential JS
7864
- // engine JIT issues.
7865
- GLctx.bufferData(target, data ? HEAPU8.subarray(data, data+size) : size, usage);
7894
+ if (true) {
7895
+ // If size is zero, WebGL would interpret uploading the whole input
7896
+ // arraybuffer (starting from given offset), which would not make sense in
7897
+ // WebAssembly, so avoid uploading if size is zero. However we must still
7898
+ // call bufferData to establish a backing storage of zero bytes.
7899
+ if (data && size) {
7900
+ GLctx.bufferData(target, HEAPU8, usage, data, size);
7901
+ } else {
7902
+ GLctx.bufferData(target, size, usage);
7903
+ }
7904
+ return;
7905
+ }
7866
7906
  };
7867
7907
  var _emscripten_glBufferData = _glBufferData;
7868
7908
 
7869
7909
  /** @suppress {duplicate } */
7870
7910
  var _glBufferSubData = (target, offset, size, data) => {
7871
- GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data+size));
7911
+ if (true) {
7912
+ size && GLctx.bufferSubData(target, offset, HEAPU8, data, size);
7913
+ return;
7914
+ }
7872
7915
  };
7873
7916
  var _emscripten_glBufferSubData = _glBufferSubData;
7874
7917
 
@@ -7880,6 +7923,31 @@ var ASM_CONSTS = {
7880
7923
  var _glClear = (x0) => GLctx.clear(x0);
7881
7924
  var _emscripten_glClear = _glClear;
7882
7925
 
7926
+ /** @suppress {duplicate } */
7927
+ var _glClearBufferfi = (x0, x1, x2, x3) => GLctx.clearBufferfi(x0, x1, x2, x3);
7928
+ var _emscripten_glClearBufferfi = _glClearBufferfi;
7929
+
7930
+ /** @suppress {duplicate } */
7931
+ var _glClearBufferfv = (buffer, drawbuffer, value) => {
7932
+
7933
+ GLctx.clearBufferfv(buffer, drawbuffer, HEAPF32, ((value)>>2));
7934
+ };
7935
+ var _emscripten_glClearBufferfv = _glClearBufferfv;
7936
+
7937
+ /** @suppress {duplicate } */
7938
+ var _glClearBufferiv = (buffer, drawbuffer, value) => {
7939
+
7940
+ GLctx.clearBufferiv(buffer, drawbuffer, HEAP32, ((value)>>2));
7941
+ };
7942
+ var _emscripten_glClearBufferiv = _glClearBufferiv;
7943
+
7944
+ /** @suppress {duplicate } */
7945
+ var _glClearBufferuiv = (buffer, drawbuffer, value) => {
7946
+
7947
+ GLctx.clearBufferuiv(buffer, drawbuffer, HEAPU32, ((value)>>2));
7948
+ };
7949
+ var _emscripten_glClearBufferuiv = _glClearBufferuiv;
7950
+
7883
7951
  /** @suppress {duplicate } */
7884
7952
  var _glClearColor = (x0, x1, x2, x3) => GLctx.clearColor(x0, x1, x2, x3);
7885
7953
  var _emscripten_glClearColor = _glClearColor;
@@ -7892,6 +7960,17 @@ var ASM_CONSTS = {
7892
7960
  var _glClearStencil = (x0) => GLctx.clearStencil(x0);
7893
7961
  var _emscripten_glClearStencil = _glClearStencil;
7894
7962
 
7963
+ /** @suppress {duplicate } */
7964
+ var _glClientWaitSync = (sync, flags, timeout) => {
7965
+ // WebGL2 vs GLES3 differences: in GLES3, the timeout parameter is a uint64, where 0xFFFFFFFFFFFFFFFFULL means GL_TIMEOUT_IGNORED.
7966
+ // 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.
7967
+ // Inherently the value accepted in the timeout is lossy, and can't take in arbitrary u64 bit pattern (but most likely doesn't matter)
7968
+ // See https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.15
7969
+ timeout = Number(timeout);
7970
+ return GLctx.clientWaitSync(GL.syncs[sync], flags, timeout);
7971
+ };
7972
+ var _emscripten_glClientWaitSync = _glClientWaitSync;
7973
+
7895
7974
  /** @suppress {duplicate } */
7896
7975
  var _glClipControlEXT = (origin, depth) => {
7897
7976
  GLctx.extClipControl['clipControlEXT'](origin, depth);
@@ -7917,16 +7996,54 @@ var ASM_CONSTS = {
7917
7996
  // final data parameter, so we simply pass a heap view starting at zero
7918
7997
  // effectively uploading whatever happens to be near address zero. See
7919
7998
  // https://github.com/emscripten-core/emscripten/issues/19300.
7920
- GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, HEAPU8.subarray((data), data+imageSize));
7999
+ if (true) {
8000
+ if (GLctx.currentPixelUnpackBufferBinding || !imageSize) {
8001
+ GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data);
8002
+ return;
8003
+ }
8004
+ GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, HEAPU8, data, imageSize);
8005
+ return;
8006
+ }
7921
8007
  };
7922
8008
  var _emscripten_glCompressedTexImage2D = _glCompressedTexImage2D;
7923
8009
 
8010
+ /** @suppress {duplicate } */
8011
+ var _glCompressedTexImage3D = (target, level, internalFormat, width, height, depth, border, imageSize, data) => {
8012
+ if (GLctx.currentPixelUnpackBufferBinding) {
8013
+ GLctx.compressedTexImage3D(target, level, internalFormat, width, height, depth, border, imageSize, data);
8014
+ } else {
8015
+ GLctx.compressedTexImage3D(target, level, internalFormat, width, height, depth, border, HEAPU8, data, imageSize);
8016
+ }
8017
+ };
8018
+ var _emscripten_glCompressedTexImage3D = _glCompressedTexImage3D;
8019
+
7924
8020
  /** @suppress {duplicate } */
7925
8021
  var _glCompressedTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, imageSize, data) => {
7926
- GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, HEAPU8.subarray((data), data+imageSize));
8022
+ if (true) {
8023
+ if (GLctx.currentPixelUnpackBufferBinding || !imageSize) {
8024
+ GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
8025
+ return;
8026
+ }
8027
+ GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, HEAPU8, data, imageSize);
8028
+ return;
8029
+ }
7927
8030
  };
7928
8031
  var _emscripten_glCompressedTexSubImage2D = _glCompressedTexSubImage2D;
7929
8032
 
8033
+ /** @suppress {duplicate } */
8034
+ var _glCompressedTexSubImage3D = (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data) => {
8035
+ if (GLctx.currentPixelUnpackBufferBinding) {
8036
+ GLctx.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
8037
+ } else {
8038
+ GLctx.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, HEAPU8, data, imageSize);
8039
+ }
8040
+ };
8041
+ var _emscripten_glCompressedTexSubImage3D = _glCompressedTexSubImage3D;
8042
+
8043
+ /** @suppress {duplicate } */
8044
+ var _glCopyBufferSubData = (x0, x1, x2, x3, x4) => GLctx.copyBufferSubData(x0, x1, x2, x3, x4);
8045
+ var _emscripten_glCopyBufferSubData = _glCopyBufferSubData;
8046
+
7930
8047
  /** @suppress {duplicate } */
7931
8048
  var _glCopyTexImage2D = (x0, x1, x2, x3, x4, x5, x6, x7) => GLctx.copyTexImage2D(x0, x1, x2, x3, x4, x5, x6, x7);
7932
8049
  var _emscripten_glCopyTexImage2D = _glCopyTexImage2D;
@@ -7935,6 +8052,10 @@ var ASM_CONSTS = {
7935
8052
  var _glCopyTexSubImage2D = (x0, x1, x2, x3, x4, x5, x6, x7) => GLctx.copyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7);
7936
8053
  var _emscripten_glCopyTexSubImage2D = _glCopyTexSubImage2D;
7937
8054
 
8055
+ /** @suppress {duplicate } */
8056
+ var _glCopyTexSubImage3D = (x0, x1, x2, x3, x4, x5, x6, x7, x8) => GLctx.copyTexSubImage3D(x0, x1, x2, x3, x4, x5, x6, x7, x8);
8057
+ var _emscripten_glCopyTexSubImage3D = _glCopyTexSubImage3D;
8058
+
7938
8059
  /** @suppress {duplicate } */
7939
8060
  var _glCreateProgram = () => {
7940
8061
  var id = GL.getNewId(GL.programs);
@@ -7977,6 +8098,8 @@ var ASM_CONSTS = {
7977
8098
  buffer.name = 0;
7978
8099
  GL.buffers[id] = null;
7979
8100
 
8101
+ if (id == GLctx.currentPixelPackBufferBinding) GLctx.currentPixelPackBufferBinding = 0;
8102
+ if (id == GLctx.currentPixelUnpackBufferBinding) GLctx.currentPixelUnpackBufferBinding = 0;
7980
8103
  }
7981
8104
  };
7982
8105
  var _emscripten_glDeleteBuffers = _glDeleteBuffers;
@@ -8010,6 +8133,18 @@ var ASM_CONSTS = {
8010
8133
  };
8011
8134
  var _emscripten_glDeleteProgram = _glDeleteProgram;
8012
8135
 
8136
+ /** @suppress {duplicate } */
8137
+ var _glDeleteQueries = (n, ids) => {
8138
+ for (var i = 0; i < n; i++) {
8139
+ var id = HEAP32[(((ids)+(i*4))>>2)];
8140
+ var query = GL.queries[id];
8141
+ if (!query) continue; // GL spec: "unused names in ids are ignored, as is the name zero."
8142
+ GLctx.deleteQuery(query);
8143
+ GL.queries[id] = null;
8144
+ }
8145
+ };
8146
+ var _emscripten_glDeleteQueries = _glDeleteQueries;
8147
+
8013
8148
  /** @suppress {duplicate } */
8014
8149
  var _glDeleteQueriesEXT = (n, ids) => {
8015
8150
  for (var i = 0; i < n; i++) {
@@ -8035,6 +8170,19 @@ var ASM_CONSTS = {
8035
8170
  };
8036
8171
  var _emscripten_glDeleteRenderbuffers = _glDeleteRenderbuffers;
8037
8172
 
8173
+ /** @suppress {duplicate } */
8174
+ var _glDeleteSamplers = (n, samplers) => {
8175
+ for (var i = 0; i < n; i++) {
8176
+ var id = HEAP32[(((samplers)+(i*4))>>2)];
8177
+ var sampler = GL.samplers[id];
8178
+ if (!sampler) continue;
8179
+ GLctx.deleteSampler(sampler);
8180
+ sampler.name = 0;
8181
+ GL.samplers[id] = null;
8182
+ }
8183
+ };
8184
+ var _emscripten_glDeleteSamplers = _glDeleteSamplers;
8185
+
8038
8186
  /** @suppress {duplicate } */
8039
8187
  var _glDeleteShader = (id) => {
8040
8188
  if (!id) return;
@@ -8050,6 +8198,20 @@ var ASM_CONSTS = {
8050
8198
  };
8051
8199
  var _emscripten_glDeleteShader = _glDeleteShader;
8052
8200
 
8201
+ /** @suppress {duplicate } */
8202
+ var _glDeleteSync = (id) => {
8203
+ if (!id) return;
8204
+ var sync = GL.syncs[id];
8205
+ if (!sync) { // glDeleteSync signals an error when deleting a nonexisting object, unlike some other GL delete functions.
8206
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8207
+ return;
8208
+ }
8209
+ GLctx.deleteSync(sync);
8210
+ sync.name = 0;
8211
+ GL.syncs[id] = null;
8212
+ };
8213
+ var _emscripten_glDeleteSync = _glDeleteSync;
8214
+
8053
8215
  /** @suppress {duplicate } */
8054
8216
  var _glDeleteTextures = (n, textures) => {
8055
8217
  for (var i = 0; i < n; i++) {
@@ -8065,7 +8227,19 @@ var ASM_CONSTS = {
8065
8227
  };
8066
8228
  var _emscripten_glDeleteTextures = _glDeleteTextures;
8067
8229
 
8068
-
8230
+ /** @suppress {duplicate } */
8231
+ var _glDeleteTransformFeedbacks = (n, ids) => {
8232
+ for (var i = 0; i < n; i++) {
8233
+ var id = HEAP32[(((ids)+(i*4))>>2)];
8234
+ var transformFeedback = GL.transformFeedbacks[id];
8235
+ if (!transformFeedback) continue; // GL spec: "unused names in ids are ignored, as is the name zero."
8236
+ GLctx.deleteTransformFeedback(transformFeedback);
8237
+ transformFeedback.name = 0;
8238
+ GL.transformFeedbacks[id] = null;
8239
+ }
8240
+ };
8241
+ var _emscripten_glDeleteTransformFeedbacks = _glDeleteTransformFeedbacks;
8242
+
8069
8243
  /** @suppress {duplicate } */
8070
8244
  var _glDeleteVertexArrays = (n, vaos) => {
8071
8245
  for (var i = 0; i < n; i++) {
@@ -8074,6 +8248,9 @@ var ASM_CONSTS = {
8074
8248
  GL.vaos[id] = null;
8075
8249
  }
8076
8250
  };
8251
+ var _emscripten_glDeleteVertexArrays = _glDeleteVertexArrays;
8252
+
8253
+
8077
8254
  /** @suppress {duplicate } */
8078
8255
  var _glDeleteVertexArraysOES = _glDeleteVertexArrays;
8079
8256
  var _emscripten_glDeleteVertexArraysOES = _glDeleteVertexArraysOES;
@@ -8116,16 +8293,32 @@ var ASM_CONSTS = {
8116
8293
  };
8117
8294
  var _emscripten_glDrawArrays = _glDrawArrays;
8118
8295
 
8119
-
8120
8296
  /** @suppress {duplicate } */
8121
8297
  var _glDrawArraysInstanced = (mode, first, count, primcount) => {
8122
8298
  GLctx.drawArraysInstanced(mode, first, count, primcount);
8123
8299
  };
8300
+ var _emscripten_glDrawArraysInstanced = _glDrawArraysInstanced;
8301
+
8302
+
8124
8303
  /** @suppress {duplicate } */
8125
8304
  var _glDrawArraysInstancedANGLE = _glDrawArraysInstanced;
8126
8305
  var _emscripten_glDrawArraysInstancedANGLE = _glDrawArraysInstancedANGLE;
8127
8306
 
8128
8307
 
8308
+ /** @suppress {duplicate } */
8309
+ var _glDrawArraysInstancedARB = _glDrawArraysInstanced;
8310
+ var _emscripten_glDrawArraysInstancedARB = _glDrawArraysInstancedARB;
8311
+
8312
+
8313
+ /** @suppress {duplicate } */
8314
+ var _glDrawArraysInstancedEXT = _glDrawArraysInstanced;
8315
+ var _emscripten_glDrawArraysInstancedEXT = _glDrawArraysInstancedEXT;
8316
+
8317
+
8318
+ /** @suppress {duplicate } */
8319
+ var _glDrawArraysInstancedNV = _glDrawArraysInstanced;
8320
+ var _emscripten_glDrawArraysInstancedNV = _glDrawArraysInstancedNV;
8321
+
8129
8322
  var tempFixedLengthArray = [];
8130
8323
 
8131
8324
  /** @suppress {duplicate } */
@@ -8138,6 +8331,14 @@ var ASM_CONSTS = {
8138
8331
 
8139
8332
  GLctx.drawBuffers(bufArray);
8140
8333
  };
8334
+ var _emscripten_glDrawBuffers = _glDrawBuffers;
8335
+
8336
+
8337
+ /** @suppress {duplicate } */
8338
+ var _glDrawBuffersEXT = _glDrawBuffers;
8339
+ var _emscripten_glDrawBuffersEXT = _glDrawBuffersEXT;
8340
+
8341
+
8141
8342
  /** @suppress {duplicate } */
8142
8343
  var _glDrawBuffersWEBGL = _glDrawBuffers;
8143
8344
  var _emscripten_glDrawBuffersWEBGL = _glDrawBuffersWEBGL;
@@ -8150,15 +8351,42 @@ var ASM_CONSTS = {
8150
8351
  };
8151
8352
  var _emscripten_glDrawElements = _glDrawElements;
8152
8353
 
8153
-
8154
8354
  /** @suppress {duplicate } */
8155
8355
  var _glDrawElementsInstanced = (mode, count, type, indices, primcount) => {
8156
8356
  GLctx.drawElementsInstanced(mode, count, type, indices, primcount);
8157
8357
  };
8358
+ var _emscripten_glDrawElementsInstanced = _glDrawElementsInstanced;
8359
+
8360
+
8158
8361
  /** @suppress {duplicate } */
8159
8362
  var _glDrawElementsInstancedANGLE = _glDrawElementsInstanced;
8160
8363
  var _emscripten_glDrawElementsInstancedANGLE = _glDrawElementsInstancedANGLE;
8161
8364
 
8365
+
8366
+ /** @suppress {duplicate } */
8367
+ var _glDrawElementsInstancedARB = _glDrawElementsInstanced;
8368
+ var _emscripten_glDrawElementsInstancedARB = _glDrawElementsInstancedARB;
8369
+
8370
+
8371
+ /** @suppress {duplicate } */
8372
+ var _glDrawElementsInstancedEXT = _glDrawElementsInstanced;
8373
+ var _emscripten_glDrawElementsInstancedEXT = _glDrawElementsInstancedEXT;
8374
+
8375
+
8376
+ /** @suppress {duplicate } */
8377
+ var _glDrawElementsInstancedNV = _glDrawElementsInstanced;
8378
+ var _emscripten_glDrawElementsInstancedNV = _glDrawElementsInstancedNV;
8379
+
8380
+ /** @suppress {duplicate } */
8381
+ var _glDrawRangeElements = (mode, start, end, count, type, indices) => {
8382
+ // TODO: This should be a trivial pass-though function registered at the bottom of this page as
8383
+ // glFuncs[6][1] += ' drawRangeElements';
8384
+ // but due to https://bugzilla.mozilla.org/show_bug.cgi?id=1202427,
8385
+ // we work around by ignoring the range.
8386
+ _glDrawElements(mode, count, type, indices);
8387
+ };
8388
+ var _emscripten_glDrawRangeElements = _glDrawRangeElements;
8389
+
8162
8390
  /** @suppress {duplicate } */
8163
8391
  var _glEnable = (x0) => GLctx.enable(x0);
8164
8392
  var _emscripten_glEnable = _glEnable;
@@ -8169,12 +8397,33 @@ var ASM_CONSTS = {
8169
8397
  };
8170
8398
  var _emscripten_glEnableVertexAttribArray = _glEnableVertexAttribArray;
8171
8399
 
8400
+ /** @suppress {duplicate } */
8401
+ var _glEndQuery = (x0) => GLctx.endQuery(x0);
8402
+ var _emscripten_glEndQuery = _glEndQuery;
8403
+
8172
8404
  /** @suppress {duplicate } */
8173
8405
  var _glEndQueryEXT = (target) => {
8174
8406
  GLctx.disjointTimerQueryExt['endQueryEXT'](target);
8175
8407
  };
8176
8408
  var _emscripten_glEndQueryEXT = _glEndQueryEXT;
8177
8409
 
8410
+ /** @suppress {duplicate } */
8411
+ var _glEndTransformFeedback = () => GLctx.endTransformFeedback();
8412
+ var _emscripten_glEndTransformFeedback = _glEndTransformFeedback;
8413
+
8414
+ /** @suppress {duplicate } */
8415
+ var _glFenceSync = (condition, flags) => {
8416
+ var sync = GLctx.fenceSync(condition, flags);
8417
+ if (sync) {
8418
+ var id = GL.getNewId(GL.syncs);
8419
+ sync.name = id;
8420
+ GL.syncs[id] = sync;
8421
+ return id;
8422
+ }
8423
+ return 0; // Failed to create a sync object
8424
+ };
8425
+ var _emscripten_glFenceSync = _glFenceSync;
8426
+
8178
8427
  /** @suppress {duplicate } */
8179
8428
  var _glFinish = () => GLctx.finish();
8180
8429
  var _emscripten_glFinish = _glFinish;
@@ -8197,6 +8446,12 @@ var ASM_CONSTS = {
8197
8446
  };
8198
8447
  var _emscripten_glFramebufferTexture2D = _glFramebufferTexture2D;
8199
8448
 
8449
+ /** @suppress {duplicate } */
8450
+ var _glFramebufferTextureLayer = (target, attachment, texture, level, layer) => {
8451
+ GLctx.framebufferTextureLayer(target, attachment, GL.textures[texture], level, layer);
8452
+ };
8453
+ var _emscripten_glFramebufferTextureLayer = _glFramebufferTextureLayer;
8454
+
8200
8455
  /** @suppress {duplicate } */
8201
8456
  var _glFrontFace = (x0) => GLctx.frontFace(x0);
8202
8457
  var _emscripten_glFrontFace = _glFrontFace;
@@ -8215,6 +8470,13 @@ var ASM_CONSTS = {
8215
8470
  };
8216
8471
  var _emscripten_glGenFramebuffers = _glGenFramebuffers;
8217
8472
 
8473
+ /** @suppress {duplicate } */
8474
+ var _glGenQueries = (n, ids) => {
8475
+ GL.genObject(n, ids, 'createQuery', GL.queries
8476
+ );
8477
+ };
8478
+ var _emscripten_glGenQueries = _glGenQueries;
8479
+
8218
8480
  /** @suppress {duplicate } */
8219
8481
  var _glGenQueriesEXT = (n, ids) => {
8220
8482
  for (var i = 0; i < n; i++) {
@@ -8239,6 +8501,13 @@ var ASM_CONSTS = {
8239
8501
  };
8240
8502
  var _emscripten_glGenRenderbuffers = _glGenRenderbuffers;
8241
8503
 
8504
+ /** @suppress {duplicate } */
8505
+ var _glGenSamplers = (n, samplers) => {
8506
+ GL.genObject(n, samplers, 'createSampler', GL.samplers
8507
+ );
8508
+ };
8509
+ var _emscripten_glGenSamplers = _glGenSamplers;
8510
+
8242
8511
  /** @suppress {duplicate } */
8243
8512
  var _glGenTextures = (n, textures) => {
8244
8513
  GL.genObject(n, textures, 'createTexture', GL.textures
@@ -8246,12 +8515,21 @@ var ASM_CONSTS = {
8246
8515
  };
8247
8516
  var _emscripten_glGenTextures = _glGenTextures;
8248
8517
 
8249
-
8518
+ /** @suppress {duplicate } */
8519
+ var _glGenTransformFeedbacks = (n, ids) => {
8520
+ GL.genObject(n, ids, 'createTransformFeedback', GL.transformFeedbacks
8521
+ );
8522
+ };
8523
+ var _emscripten_glGenTransformFeedbacks = _glGenTransformFeedbacks;
8524
+
8250
8525
  /** @suppress {duplicate } */
8251
8526
  var _glGenVertexArrays = (n, arrays) => {
8252
8527
  GL.genObject(n, arrays, 'createVertexArray', GL.vaos
8253
8528
  );
8254
8529
  };
8530
+ var _emscripten_glGenVertexArrays = _glGenVertexArrays;
8531
+
8532
+
8255
8533
  /** @suppress {duplicate } */
8256
8534
  var _glGenVertexArraysOES = _glGenVertexArrays;
8257
8535
  var _emscripten_glGenVertexArraysOES = _glGenVertexArraysOES;
@@ -8284,6 +8562,77 @@ var ASM_CONSTS = {
8284
8562
  __glGetActiveAttribOrUniform('getActiveUniform', program, index, bufSize, length, size, type, name);
8285
8563
  var _emscripten_glGetActiveUniform = _glGetActiveUniform;
8286
8564
 
8565
+ /** @suppress {duplicate } */
8566
+ var _glGetActiveUniformBlockName = (program, uniformBlockIndex, bufSize, length, uniformBlockName) => {
8567
+ program = GL.programs[program];
8568
+
8569
+ var result = GLctx.getActiveUniformBlockName(program, uniformBlockIndex);
8570
+ if (!result) return; // If an error occurs, nothing will be written to uniformBlockName or length.
8571
+ if (uniformBlockName && bufSize > 0) {
8572
+ var numBytesWrittenExclNull = stringToUTF8(result, uniformBlockName, bufSize);
8573
+ if (length) HEAP32[((length)>>2)] = numBytesWrittenExclNull;
8574
+ } else {
8575
+ if (length) HEAP32[((length)>>2)] = 0;
8576
+ }
8577
+ };
8578
+ var _emscripten_glGetActiveUniformBlockName = _glGetActiveUniformBlockName;
8579
+
8580
+ /** @suppress {duplicate } */
8581
+ var _glGetActiveUniformBlockiv = (program, uniformBlockIndex, pname, params) => {
8582
+ if (!params) {
8583
+ // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
8584
+ // if params == null, issue a GL error to notify user about it.
8585
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8586
+ return;
8587
+ }
8588
+ program = GL.programs[program];
8589
+
8590
+ if (pname == 0x8A41 /* GL_UNIFORM_BLOCK_NAME_LENGTH */) {
8591
+ var name = GLctx.getActiveUniformBlockName(program, uniformBlockIndex);
8592
+ HEAP32[((params)>>2)] = name.length+1;
8593
+ return;
8594
+ }
8595
+
8596
+ var result = GLctx.getActiveUniformBlockParameter(program, uniformBlockIndex, pname);
8597
+ if (result === null) return; // If an error occurs, nothing should be written to params.
8598
+ if (pname == 0x8A43 /*GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES*/) {
8599
+ for (var i = 0; i < result.length; i++) {
8600
+ HEAP32[(((params)+(i*4))>>2)] = result[i];
8601
+ }
8602
+ } else {
8603
+ HEAP32[((params)>>2)] = result;
8604
+ }
8605
+ };
8606
+ var _emscripten_glGetActiveUniformBlockiv = _glGetActiveUniformBlockiv;
8607
+
8608
+ /** @suppress {duplicate } */
8609
+ var _glGetActiveUniformsiv = (program, uniformCount, uniformIndices, pname, params) => {
8610
+ if (!params) {
8611
+ // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
8612
+ // if params == null, issue a GL error to notify user about it.
8613
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8614
+ return;
8615
+ }
8616
+ if (uniformCount > 0 && uniformIndices == 0) {
8617
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8618
+ return;
8619
+ }
8620
+ program = GL.programs[program];
8621
+ var ids = [];
8622
+ for (var i = 0; i < uniformCount; i++) {
8623
+ ids.push(HEAP32[(((uniformIndices)+(i*4))>>2)]);
8624
+ }
8625
+
8626
+ var result = GLctx.getActiveUniforms(program, ids, pname);
8627
+ if (!result) return; // GL spec: If an error is generated, nothing is written out to params.
8628
+
8629
+ var len = result.length;
8630
+ for (var i = 0; i < len; i++) {
8631
+ HEAP32[(((params)+(i*4))>>2)] = result[i];
8632
+ }
8633
+ };
8634
+ var _emscripten_glGetActiveUniformsiv = _glGetActiveUniformsiv;
8635
+
8287
8636
  /** @suppress {duplicate } */
8288
8637
  var _glGetAttachedShaders = (program, maxCount, count, shaders) => {
8289
8638
  var result = GLctx.getAttachedShaders(GL.programs[program]);
@@ -8311,6 +8660,13 @@ var ASM_CONSTS = {
8311
8660
  HEAPU32[(((ptr)+(4))>>2)] = (num - lower)/4294967296;
8312
8661
  };
8313
8662
 
8663
+
8664
+ var webglGetExtensions = () => {
8665
+ var exts = getEmscriptenSupportedExtensions(GLctx);
8666
+ exts = exts.concat(exts.map((e) => "GL_" + e));
8667
+ return exts;
8668
+ };
8669
+
8314
8670
  var emscriptenWebGLGet = (name_, p, type) => {
8315
8671
  // Guard against user passing a null pointer.
8316
8672
  // Note that GLES2 spec does not say anything about how passing a null
@@ -8333,6 +8689,7 @@ var ASM_CONSTS = {
8333
8689
  // Do not write anything to the out pointer, since no binary formats are
8334
8690
  // supported.
8335
8691
  return;
8692
+ case 0x87FE: // GL_NUM_PROGRAM_BINARY_FORMATS
8336
8693
  case 0x8DF9: // GL_NUM_SHADER_BINARY_FORMATS
8337
8694
  ret = 0;
8338
8695
  break;
@@ -8345,6 +8702,22 @@ var ASM_CONSTS = {
8345
8702
  ret = formats ? formats.length : 0;
8346
8703
  break;
8347
8704
 
8705
+ case 0x821D: // GL_NUM_EXTENSIONS
8706
+ if (GL.currentContext.version < 2) {
8707
+ // Calling GLES3/WebGL2 function with a GLES2/WebGL1 context
8708
+ GL.recordError(0x502 /* GL_INVALID_OPERATION */);
8709
+ return;
8710
+ }
8711
+ ret = webglGetExtensions().length;
8712
+ break;
8713
+ case 0x821B: // GL_MAJOR_VERSION
8714
+ case 0x821C: // GL_MINOR_VERSION
8715
+ if (GL.currentContext.version < 2) {
8716
+ GL.recordError(0x500); // GL_INVALID_ENUM
8717
+ return;
8718
+ }
8719
+ ret = name_ == 0x821B ? 3 : 0; // return version 3.0
8720
+ break;
8348
8721
  }
8349
8722
 
8350
8723
  if (ret === undefined) {
@@ -8372,6 +8745,17 @@ var ASM_CONSTS = {
8372
8745
  case 0x8CA7: // RENDERBUFFER_BINDING
8373
8746
  case 0x8069: // TEXTURE_BINDING_2D
8374
8747
  case 0x85B5: // WebGL 2 GL_VERTEX_ARRAY_BINDING, or WebGL 1 extension OES_vertex_array_object GL_VERTEX_ARRAY_BINDING_OES
8748
+ case 0x8F36: // COPY_READ_BUFFER_BINDING or COPY_READ_BUFFER
8749
+ case 0x8F37: // COPY_WRITE_BUFFER_BINDING or COPY_WRITE_BUFFER
8750
+ case 0x88ED: // PIXEL_PACK_BUFFER_BINDING
8751
+ case 0x88EF: // PIXEL_UNPACK_BUFFER_BINDING
8752
+ case 0x8CAA: // READ_FRAMEBUFFER_BINDING
8753
+ case 0x8919: // SAMPLER_BINDING
8754
+ case 0x8C1D: // TEXTURE_BINDING_2D_ARRAY
8755
+ case 0x806A: // TEXTURE_BINDING_3D
8756
+ case 0x8E25: // TRANSFORM_FEEDBACK_BINDING
8757
+ case 0x8C8F: // TRANSFORM_FEEDBACK_BUFFER_BINDING
8758
+ case 0x8A28: // UNIFORM_BUFFER_BINDING
8375
8759
  case 0x8514: { // TEXTURE_BINDING_CUBE_MAP
8376
8760
  ret = 0;
8377
8761
  break;
@@ -8422,6 +8806,18 @@ var ASM_CONSTS = {
8422
8806
  var _glGetBooleanv = (name_, p) => emscriptenWebGLGet(name_, p, 4);
8423
8807
  var _emscripten_glGetBooleanv = _glGetBooleanv;
8424
8808
 
8809
+ /** @suppress {duplicate } */
8810
+ var _glGetBufferParameteri64v = (target, value, data) => {
8811
+ if (!data) {
8812
+ // GLES2 specification does not specify how to behave if data is a null pointer. Since calling this function does not make sense
8813
+ // if data == null, issue a GL error to notify user about it.
8814
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8815
+ return;
8816
+ }
8817
+ writeI53ToI64(data, GLctx.getBufferParameter(target, value));
8818
+ };
8819
+ var _emscripten_glGetBufferParameteri64v = _glGetBufferParameteri64v;
8820
+
8425
8821
  /** @suppress {duplicate } */
8426
8822
  var _glGetBufferParameteriv = (target, value, data) => {
8427
8823
  if (!data) {
@@ -8448,6 +8844,12 @@ var ASM_CONSTS = {
8448
8844
  var _glGetFloatv = (name_, p) => emscriptenWebGLGet(name_, p, 2);
8449
8845
  var _emscripten_glGetFloatv = _glGetFloatv;
8450
8846
 
8847
+ /** @suppress {duplicate } */
8848
+ var _glGetFragDataLocation = (program, name) => {
8849
+ return GLctx.getFragDataLocation(GL.programs[program], UTF8ToString(name));
8850
+ };
8851
+ var _emscripten_glGetFragDataLocation = _glGetFragDataLocation;
8852
+
8451
8853
  /** @suppress {duplicate } */
8452
8854
  var _glGetFramebufferAttachmentParameteriv = (target, attachment, pname, params) => {
8453
8855
  var result = GLctx.getFramebufferAttachmentParameter(target, attachment, pname);
@@ -8459,11 +8861,101 @@ var ASM_CONSTS = {
8459
8861
  };
8460
8862
  var _emscripten_glGetFramebufferAttachmentParameteriv = _glGetFramebufferAttachmentParameteriv;
8461
8863
 
8864
+ var emscriptenWebGLGetIndexed = (target, index, data, type) => {
8865
+ if (!data) {
8866
+ // GLES2 specification does not specify how to behave if data is a null pointer. Since calling this function does not make sense
8867
+ // if data == null, issue a GL error to notify user about it.
8868
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8869
+ return;
8870
+ }
8871
+ var result = GLctx.getIndexedParameter(target, index);
8872
+ var ret;
8873
+ switch (typeof result) {
8874
+ case 'boolean':
8875
+ ret = result ? 1 : 0;
8876
+ break;
8877
+ case 'number':
8878
+ ret = result;
8879
+ break;
8880
+ case 'object':
8881
+ if (result === null) {
8882
+ switch (target) {
8883
+ case 0x8C8F: // TRANSFORM_FEEDBACK_BUFFER_BINDING
8884
+ case 0x8A28: // UNIFORM_BUFFER_BINDING
8885
+ ret = 0;
8886
+ break;
8887
+ default: {
8888
+ GL.recordError(0x500); // GL_INVALID_ENUM
8889
+ return;
8890
+ }
8891
+ }
8892
+ } else if (result instanceof WebGLBuffer) {
8893
+ ret = result.name | 0;
8894
+ } else {
8895
+ GL.recordError(0x500); // GL_INVALID_ENUM
8896
+ return;
8897
+ }
8898
+ break;
8899
+ default:
8900
+ GL.recordError(0x500); // GL_INVALID_ENUM
8901
+ return;
8902
+ }
8903
+
8904
+ switch (type) {
8905
+ case 1: writeI53ToI64(data, ret); break;
8906
+ case 0: HEAP32[((data)>>2)] = ret; break;
8907
+ case 2: HEAPF32[((data)>>2)] = ret; break;
8908
+ case 4: HEAP8[data] = ret ? 1 : 0; break;
8909
+ default: throw 'internal emscriptenWebGLGetIndexed() error, bad type: ' + type;
8910
+ }
8911
+ };
8912
+ /** @suppress {duplicate } */
8913
+ var _glGetInteger64i_v = (target, index, data) =>
8914
+ emscriptenWebGLGetIndexed(target, index, data, 1);
8915
+ var _emscripten_glGetInteger64i_v = _glGetInteger64i_v;
8916
+
8917
+ /** @suppress {duplicate } */
8918
+ var _glGetInteger64v = (name_, p) => {
8919
+ emscriptenWebGLGet(name_, p, 1);
8920
+ };
8921
+ var _emscripten_glGetInteger64v = _glGetInteger64v;
8922
+
8923
+ /** @suppress {duplicate } */
8924
+ var _glGetIntegeri_v = (target, index, data) =>
8925
+ emscriptenWebGLGetIndexed(target, index, data, 0);
8926
+ var _emscripten_glGetIntegeri_v = _glGetIntegeri_v;
8927
+
8462
8928
 
8463
8929
  /** @suppress {duplicate } */
8464
8930
  var _glGetIntegerv = (name_, p) => emscriptenWebGLGet(name_, p, 0);
8465
8931
  var _emscripten_glGetIntegerv = _glGetIntegerv;
8466
8932
 
8933
+ /** @suppress {duplicate } */
8934
+ var _glGetInternalformativ = (target, internalformat, pname, bufSize, params) => {
8935
+ if (bufSize < 0) {
8936
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8937
+ return;
8938
+ }
8939
+ if (!params) {
8940
+ // GLES3 specification does not specify how to behave if values is a null pointer. Since calling this function does not make sense
8941
+ // if values == null, issue a GL error to notify user about it.
8942
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
8943
+ return;
8944
+ }
8945
+ var ret = GLctx.getInternalformatParameter(target, internalformat, pname);
8946
+ if (ret === null) return;
8947
+ for (var i = 0; i < ret.length && i < bufSize; ++i) {
8948
+ HEAP32[(((params)+(i*4))>>2)] = ret[i];
8949
+ }
8950
+ };
8951
+ var _emscripten_glGetInternalformativ = _glGetInternalformativ;
8952
+
8953
+ /** @suppress {duplicate } */
8954
+ var _glGetProgramBinary = (program, bufSize, length, binaryFormat, binary) => {
8955
+ GL.recordError(0x502/*GL_INVALID_OPERATION*/);
8956
+ };
8957
+ var _emscripten_glGetProgramBinary = _glGetProgramBinary;
8958
+
8467
8959
  /** @suppress {duplicate } */
8468
8960
  var _glGetProgramInfoLog = (program, maxLength, length, infoLog) => {
8469
8961
  var log = GLctx.getProgramInfoLog(GL.programs[program]);
@@ -8535,9 +9027,13 @@ var ASM_CONSTS = {
8535
9027
  }
8536
9028
  var query = GL.queries[id];
8537
9029
  var param;
9030
+ if (GL.currentContext.version < 2)
8538
9031
  {
8539
9032
  param = GLctx.disjointTimerQueryExt['getQueryObjectEXT'](query, pname);
8540
9033
  }
9034
+ else {
9035
+ param = GLctx.getQueryParameter(query, pname);
9036
+ }
8541
9037
  var ret;
8542
9038
  if (typeof param == 'boolean') {
8543
9039
  ret = param ? 1 : 0;
@@ -8573,11 +9069,43 @@ var ASM_CONSTS = {
8573
9069
  var _glGetQueryObjectui64vEXT = _glGetQueryObjecti64vEXT;
8574
9070
  var _emscripten_glGetQueryObjectui64vEXT = _glGetQueryObjectui64vEXT;
8575
9071
 
9072
+ /** @suppress {duplicate } */
9073
+ var _glGetQueryObjectuiv = (id, pname, params) => {
9074
+ if (!params) {
9075
+ // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
9076
+ // if p == null, issue a GL error to notify user about it.
9077
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9078
+ return;
9079
+ }
9080
+ var query = GL.queries[id];
9081
+ var param = GLctx.getQueryParameter(query, pname);
9082
+ var ret;
9083
+ if (typeof param == 'boolean') {
9084
+ ret = param ? 1 : 0;
9085
+ } else {
9086
+ ret = param;
9087
+ }
9088
+ HEAP32[((params)>>2)] = ret;
9089
+ };
9090
+ var _emscripten_glGetQueryObjectuiv = _glGetQueryObjectuiv;
9091
+
8576
9092
 
8577
9093
  /** @suppress {duplicate } */
8578
9094
  var _glGetQueryObjectuivEXT = _glGetQueryObjectivEXT;
8579
9095
  var _emscripten_glGetQueryObjectuivEXT = _glGetQueryObjectuivEXT;
8580
9096
 
9097
+ /** @suppress {duplicate } */
9098
+ var _glGetQueryiv = (target, pname, params) => {
9099
+ if (!params) {
9100
+ // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
9101
+ // if p == null, issue a GL error to notify user about it.
9102
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9103
+ return;
9104
+ }
9105
+ HEAP32[((params)>>2)] = GLctx.getQuery(target, pname);
9106
+ };
9107
+ var _emscripten_glGetQueryiv = _glGetQueryiv;
9108
+
8581
9109
  /** @suppress {duplicate } */
8582
9110
  var _glGetQueryivEXT = (target, pname, params) => {
8583
9111
  if (!params) {
@@ -8602,6 +9130,30 @@ var ASM_CONSTS = {
8602
9130
  };
8603
9131
  var _emscripten_glGetRenderbufferParameteriv = _glGetRenderbufferParameteriv;
8604
9132
 
9133
+ /** @suppress {duplicate } */
9134
+ var _glGetSamplerParameterfv = (sampler, pname, params) => {
9135
+ if (!params) {
9136
+ // GLES3 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
9137
+ // if p == null, issue a GL error to notify user about it.
9138
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9139
+ return;
9140
+ }
9141
+ HEAPF32[((params)>>2)] = GLctx.getSamplerParameter(GL.samplers[sampler], pname);
9142
+ };
9143
+ var _emscripten_glGetSamplerParameterfv = _glGetSamplerParameterfv;
9144
+
9145
+ /** @suppress {duplicate } */
9146
+ var _glGetSamplerParameteriv = (sampler, pname, params) => {
9147
+ if (!params) {
9148
+ // GLES3 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
9149
+ // if p == null, issue a GL error to notify user about it.
9150
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9151
+ return;
9152
+ }
9153
+ HEAP32[((params)>>2)] = GLctx.getSamplerParameter(GL.samplers[sampler], pname);
9154
+ };
9155
+ var _emscripten_glGetSamplerParameteriv = _glGetSamplerParameteriv;
9156
+
8605
9157
 
8606
9158
  /** @suppress {duplicate } */
8607
9159
  var _glGetShaderInfoLog = (shader, maxLength, length, infoLog) => {
@@ -8662,12 +9214,6 @@ var ASM_CONSTS = {
8662
9214
 
8663
9215
 
8664
9216
 
8665
- var webglGetExtensions = () => {
8666
- var exts = getEmscriptenSupportedExtensions(GLctx);
8667
- exts = exts.concat(exts.map((e) => "GL_" + e));
8668
- return exts;
8669
- };
8670
-
8671
9217
  /** @suppress {duplicate } */
8672
9218
  var _glGetString = (name_) => {
8673
9219
  var ret = GL.stringCache[name_];
@@ -8691,6 +9237,7 @@ var ASM_CONSTS = {
8691
9237
  var webGLVersion = GLctx.getParameter(0x1F02 /*GL_VERSION*/);
8692
9238
  // return GLES version string corresponding to the version of the WebGL context
8693
9239
  var glVersion = `OpenGL ES 2.0 (${webGLVersion})`;
9240
+ if (true) glVersion = `OpenGL ES 3.0 (${webGLVersion})`;
8694
9241
  ret = stringToNewUTF8(glVersion);
8695
9242
  break;
8696
9243
  case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */:
@@ -8714,6 +9261,59 @@ var ASM_CONSTS = {
8714
9261
  };
8715
9262
  var _emscripten_glGetString = _glGetString;
8716
9263
 
9264
+
9265
+ /** @suppress {duplicate } */
9266
+ var _glGetStringi = (name, index) => {
9267
+ if (GL.currentContext.version < 2) {
9268
+ GL.recordError(0x502 /* GL_INVALID_OPERATION */); // Calling GLES3/WebGL2 function with a GLES2/WebGL1 context
9269
+ return 0;
9270
+ }
9271
+ var stringiCache = GL.stringiCache[name];
9272
+ if (stringiCache) {
9273
+ if (index < 0 || index >= stringiCache.length) {
9274
+ GL.recordError(0x501/*GL_INVALID_VALUE*/);
9275
+ return 0;
9276
+ }
9277
+ return stringiCache[index];
9278
+ }
9279
+ switch (name) {
9280
+ case 0x1F03 /* GL_EXTENSIONS */:
9281
+ var exts = webglGetExtensions().map(stringToNewUTF8);
9282
+ stringiCache = GL.stringiCache[name] = exts;
9283
+ if (index < 0 || index >= stringiCache.length) {
9284
+ GL.recordError(0x501/*GL_INVALID_VALUE*/);
9285
+ return 0;
9286
+ }
9287
+ return stringiCache[index];
9288
+ default:
9289
+ GL.recordError(0x500/*GL_INVALID_ENUM*/);
9290
+ return 0;
9291
+ }
9292
+ };
9293
+ var _emscripten_glGetStringi = _glGetStringi;
9294
+
9295
+ /** @suppress {duplicate } */
9296
+ var _glGetSynciv = (sync, pname, bufSize, length, values) => {
9297
+ if (bufSize < 0) {
9298
+ // GLES3 specification does not specify how to behave if bufSize < 0, however in the spec wording for glGetInternalformativ, it does say that GL_INVALID_VALUE should be raised,
9299
+ // so raise GL_INVALID_VALUE here as well.
9300
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9301
+ return;
9302
+ }
9303
+ if (!values) {
9304
+ // GLES3 specification does not specify how to behave if values is a null pointer. Since calling this function does not make sense
9305
+ // if values == null, issue a GL error to notify user about it.
9306
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9307
+ return;
9308
+ }
9309
+ var ret = GLctx.getSyncParameter(GL.syncs[sync], pname);
9310
+ if (ret !== null) {
9311
+ HEAP32[((values)>>2)] = ret;
9312
+ if (length) HEAP32[((length)>>2)] = 1; // Report a single value outputted.
9313
+ }
9314
+ };
9315
+ var _emscripten_glGetSynciv = _glGetSynciv;
9316
+
8717
9317
  /** @suppress {duplicate } */
8718
9318
  var _glGetTexParameterfv = (target, pname, params) => {
8719
9319
  if (!params) {
@@ -8740,6 +9340,57 @@ var ASM_CONSTS = {
8740
9340
  };
8741
9341
  var _emscripten_glGetTexParameteriv = _glGetTexParameteriv;
8742
9342
 
9343
+ /** @suppress {duplicate } */
9344
+ var _glGetTransformFeedbackVarying = (program, index, bufSize, length, size, type, name) => {
9345
+ program = GL.programs[program];
9346
+ var info = GLctx.getTransformFeedbackVarying(program, index);
9347
+ if (!info) return; // If an error occurred, the return parameters length, size, type and name will be unmodified.
9348
+
9349
+ if (name && bufSize > 0) {
9350
+ var numBytesWrittenExclNull = stringToUTF8(info.name, name, bufSize);
9351
+ if (length) HEAP32[((length)>>2)] = numBytesWrittenExclNull;
9352
+ } else {
9353
+ if (length) HEAP32[((length)>>2)] = 0;
9354
+ }
9355
+
9356
+ if (size) HEAP32[((size)>>2)] = info.size;
9357
+ if (type) HEAP32[((type)>>2)] = info.type;
9358
+ };
9359
+ var _emscripten_glGetTransformFeedbackVarying = _glGetTransformFeedbackVarying;
9360
+
9361
+ /** @suppress {duplicate } */
9362
+ var _glGetUniformBlockIndex = (program, uniformBlockName) => {
9363
+ return GLctx.getUniformBlockIndex(GL.programs[program], UTF8ToString(uniformBlockName));
9364
+ };
9365
+ var _emscripten_glGetUniformBlockIndex = _glGetUniformBlockIndex;
9366
+
9367
+ /** @suppress {duplicate } */
9368
+ var _glGetUniformIndices = (program, uniformCount, uniformNames, uniformIndices) => {
9369
+ if (!uniformIndices) {
9370
+ // GLES2 specification does not specify how to behave if uniformIndices is a null pointer. Since calling this function does not make sense
9371
+ // if uniformIndices == null, issue a GL error to notify user about it.
9372
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9373
+ return;
9374
+ }
9375
+ if (uniformCount > 0 && (uniformNames == 0 || uniformIndices == 0)) {
9376
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9377
+ return;
9378
+ }
9379
+ program = GL.programs[program];
9380
+ var names = [];
9381
+ for (var i = 0; i < uniformCount; i++)
9382
+ names.push(UTF8ToString(HEAP32[(((uniformNames)+(i*4))>>2)]));
9383
+
9384
+ var result = GLctx.getUniformIndices(program, names);
9385
+ if (!result) return; // GL spec: If an error is generated, nothing is written out to uniformIndices.
9386
+
9387
+ var len = result.length;
9388
+ for (var i = 0; i < len; i++) {
9389
+ HEAP32[(((uniformIndices)+(i*4))>>2)] = result[i];
9390
+ }
9391
+ };
9392
+ var _emscripten_glGetUniformIndices = _glGetUniformIndices;
9393
+
8743
9394
  /** @suppress {checkTypes} */
8744
9395
  var jstoi_q = (str) => parseInt(str);
8745
9396
 
@@ -8901,17 +9552,9 @@ var ASM_CONSTS = {
8901
9552
  var _emscripten_glGetUniformiv = _glGetUniformiv;
8902
9553
 
8903
9554
  /** @suppress {duplicate } */
8904
- var _glGetVertexAttribPointerv = (index, pname, pointer) => {
8905
- if (!pointer) {
8906
- // GLES2 specification does not specify how to behave if pointer is a null
8907
- // pointer. Since calling this function does not make sense if pointer ==
8908
- // null, issue a GL error to notify user about it.
8909
- GL.recordError(0x501 /* GL_INVALID_VALUE */);
8910
- return;
8911
- }
8912
- HEAP32[((pointer)>>2)] = GLctx.getVertexAttribOffset(index, pname);
8913
- };
8914
- var _emscripten_glGetVertexAttribPointerv = _glGetVertexAttribPointerv;
9555
+ var _glGetUniformuiv = (program, location, params) =>
9556
+ emscriptenWebGLGetUniform(program, location, params, 0);
9557
+ var _emscripten_glGetUniformuiv = _glGetUniformuiv;
8915
9558
 
8916
9559
  /** @suppress{checkTypes} */
8917
9560
  var emscriptenWebGLGetVertexAttrib = (index, pname, params, type) => {
@@ -8941,6 +9584,32 @@ var ASM_CONSTS = {
8941
9584
  }
8942
9585
  }
8943
9586
  };
9587
+ /** @suppress {duplicate } */
9588
+ var _glGetVertexAttribIiv = (index, pname, params) => {
9589
+ // N.B. This function may only be called if the vertex attribute was specified using the function glVertexAttribI4iv(),
9590
+ // otherwise the results are undefined. (GLES3 spec 6.1.12)
9591
+ emscriptenWebGLGetVertexAttrib(index, pname, params, 0);
9592
+ };
9593
+ var _emscripten_glGetVertexAttribIiv = _glGetVertexAttribIiv;
9594
+
9595
+
9596
+ /** @suppress {duplicate } */
9597
+ var _glGetVertexAttribIuiv = _glGetVertexAttribIiv;
9598
+ var _emscripten_glGetVertexAttribIuiv = _glGetVertexAttribIuiv;
9599
+
9600
+ /** @suppress {duplicate } */
9601
+ var _glGetVertexAttribPointerv = (index, pname, pointer) => {
9602
+ if (!pointer) {
9603
+ // GLES2 specification does not specify how to behave if pointer is a null
9604
+ // pointer. Since calling this function does not make sense if pointer ==
9605
+ // null, issue a GL error to notify user about it.
9606
+ GL.recordError(0x501 /* GL_INVALID_VALUE */);
9607
+ return;
9608
+ }
9609
+ HEAP32[((pointer)>>2)] = GLctx.getVertexAttribOffset(index, pname);
9610
+ };
9611
+ var _emscripten_glGetVertexAttribPointerv = _glGetVertexAttribPointerv;
9612
+
8944
9613
 
8945
9614
  /** @suppress {duplicate } */
8946
9615
  var _glGetVertexAttribfv = (index, pname, params) => {
@@ -8965,6 +9634,28 @@ var ASM_CONSTS = {
8965
9634
  var _glHint = (x0, x1) => GLctx.hint(x0, x1);
8966
9635
  var _emscripten_glHint = _glHint;
8967
9636
 
9637
+ /** @suppress {duplicate } */
9638
+ var _glInvalidateFramebuffer = (target, numAttachments, attachments) => {
9639
+ var list = tempFixedLengthArray[numAttachments];
9640
+ for (var i = 0; i < numAttachments; i++) {
9641
+ list[i] = HEAP32[(((attachments)+(i*4))>>2)];
9642
+ }
9643
+
9644
+ GLctx.invalidateFramebuffer(target, list);
9645
+ };
9646
+ var _emscripten_glInvalidateFramebuffer = _glInvalidateFramebuffer;
9647
+
9648
+ /** @suppress {duplicate } */
9649
+ var _glInvalidateSubFramebuffer = (target, numAttachments, attachments, x, y, width, height) => {
9650
+ var list = tempFixedLengthArray[numAttachments];
9651
+ for (var i = 0; i < numAttachments; i++) {
9652
+ list[i] = HEAP32[(((attachments)+(i*4))>>2)];
9653
+ }
9654
+
9655
+ GLctx.invalidateSubFramebuffer(target, list, x, y, width, height);
9656
+ };
9657
+ var _emscripten_glInvalidateSubFramebuffer = _glInvalidateSubFramebuffer;
9658
+
8968
9659
  /** @suppress {duplicate } */
8969
9660
  var _glIsBuffer = (buffer) => {
8970
9661
  var b = GL.buffers[buffer];
@@ -8993,6 +9684,14 @@ var ASM_CONSTS = {
8993
9684
  };
8994
9685
  var _emscripten_glIsProgram = _glIsProgram;
8995
9686
 
9687
+ /** @suppress {duplicate } */
9688
+ var _glIsQuery = (id) => {
9689
+ var query = GL.queries[id];
9690
+ if (!query) return 0;
9691
+ return GLctx.isQuery(query);
9692
+ };
9693
+ var _emscripten_glIsQuery = _glIsQuery;
9694
+
8996
9695
  /** @suppress {duplicate } */
8997
9696
  var _glIsQueryEXT = (id) => {
8998
9697
  var query = GL.queries[id];
@@ -9009,6 +9708,14 @@ var ASM_CONSTS = {
9009
9708
  };
9010
9709
  var _emscripten_glIsRenderbuffer = _glIsRenderbuffer;
9011
9710
 
9711
+ /** @suppress {duplicate } */
9712
+ var _glIsSampler = (id) => {
9713
+ var sampler = GL.samplers[id];
9714
+ if (!sampler) return 0;
9715
+ return GLctx.isSampler(sampler);
9716
+ };
9717
+ var _emscripten_glIsSampler = _glIsSampler;
9718
+
9012
9719
  /** @suppress {duplicate } */
9013
9720
  var _glIsShader = (shader) => {
9014
9721
  var s = GL.shaders[shader];
@@ -9017,6 +9724,10 @@ var ASM_CONSTS = {
9017
9724
  };
9018
9725
  var _emscripten_glIsShader = _glIsShader;
9019
9726
 
9727
+ /** @suppress {duplicate } */
9728
+ var _glIsSync = (sync) => GLctx.isSync(GL.syncs[sync]);
9729
+ var _emscripten_glIsSync = _glIsSync;
9730
+
9020
9731
  /** @suppress {duplicate } */
9021
9732
  var _glIsTexture = (id) => {
9022
9733
  var texture = GL.textures[id];
@@ -9025,7 +9736,10 @@ var ASM_CONSTS = {
9025
9736
  };
9026
9737
  var _emscripten_glIsTexture = _glIsTexture;
9027
9738
 
9028
-
9739
+ /** @suppress {duplicate } */
9740
+ var _glIsTransformFeedback = (id) => GLctx.isTransformFeedback(GL.transformFeedbacks[id]);
9741
+ var _emscripten_glIsTransformFeedback = _glIsTransformFeedback;
9742
+
9029
9743
  /** @suppress {duplicate } */
9030
9744
  var _glIsVertexArray = (array) => {
9031
9745
 
@@ -9033,6 +9747,9 @@ var ASM_CONSTS = {
9033
9747
  if (!vao) return 0;
9034
9748
  return GLctx.isVertexArray(vao);
9035
9749
  };
9750
+ var _emscripten_glIsVertexArray = _glIsVertexArray;
9751
+
9752
+
9036
9753
  /** @suppress {duplicate } */
9037
9754
  var _glIsVertexArrayOES = _glIsVertexArray;
9038
9755
  var _emscripten_glIsVertexArrayOES = _glIsVertexArrayOES;
@@ -9052,6 +9769,10 @@ var ASM_CONSTS = {
9052
9769
  };
9053
9770
  var _emscripten_glLinkProgram = _glLinkProgram;
9054
9771
 
9772
+ /** @suppress {duplicate } */
9773
+ var _glPauseTransformFeedback = () => GLctx.pauseTransformFeedback();
9774
+ var _emscripten_glPauseTransformFeedback = _glPauseTransformFeedback;
9775
+
9055
9776
  /** @suppress {duplicate } */
9056
9777
  var _glPixelStorei = (pname, param) => {
9057
9778
  if (pname == 3317) {
@@ -9079,12 +9800,28 @@ var ASM_CONSTS = {
9079
9800
  };
9080
9801
  var _emscripten_glPolygonOffsetClampEXT = _glPolygonOffsetClampEXT;
9081
9802
 
9803
+ /** @suppress {duplicate } */
9804
+ var _glProgramBinary = (program, binaryFormat, binary, length) => {
9805
+ GL.recordError(0x500/*GL_INVALID_ENUM*/);
9806
+ };
9807
+ var _emscripten_glProgramBinary = _glProgramBinary;
9808
+
9809
+ /** @suppress {duplicate } */
9810
+ var _glProgramParameteri = (program, pname, value) => {
9811
+ GL.recordError(0x500/*GL_INVALID_ENUM*/);
9812
+ };
9813
+ var _emscripten_glProgramParameteri = _glProgramParameteri;
9814
+
9082
9815
  /** @suppress {duplicate } */
9083
9816
  var _glQueryCounterEXT = (id, target) => {
9084
9817
  GLctx.disjointTimerQueryExt['queryCounterEXT'](GL.queries[id], target);
9085
9818
  };
9086
9819
  var _emscripten_glQueryCounterEXT = _glQueryCounterEXT;
9087
9820
 
9821
+ /** @suppress {duplicate } */
9822
+ var _glReadBuffer = (x0) => GLctx.readBuffer(x0);
9823
+ var _emscripten_glReadBuffer = _glReadBuffer;
9824
+
9088
9825
  var computeUnpackAlignedImageSize = (width, height, sizePerPixel) => {
9089
9826
  function roundedToNextMultipleOf(x, y) {
9090
9827
  return (x + y - 1) & -y;
@@ -9108,6 +9845,12 @@ var ASM_CONSTS = {
9108
9845
  8: 2,
9109
9846
  29502: 3,
9110
9847
  29504: 4,
9848
+ // 0x1903 /* GL_RED */ - 0x1902: 1,
9849
+ 26917: 2,
9850
+ 26918: 2,
9851
+ // 0x8D94 /* GL_RED_INTEGER */ - 0x1902: 1,
9852
+ 29846: 3,
9853
+ 29847: 4
9111
9854
  };
9112
9855
  return colorChannels[format - 0x1902]||1;
9113
9856
  };
@@ -9118,15 +9861,21 @@ var ASM_CONSTS = {
9118
9861
  // Also the type HEAPU16 is not tested for explicitly, but any unrecognized type will return out HEAPU16.
9119
9862
  // (since most types are HEAPU16)
9120
9863
  type -= 0x1400;
9864
+ if (type == 0) return HEAP8;
9121
9865
 
9122
9866
  if (type == 1) return HEAPU8;
9123
9867
 
9868
+ if (type == 2) return HEAP16;
9869
+
9124
9870
  if (type == 4) return HEAP32;
9125
9871
 
9126
9872
  if (type == 6) return HEAPF32;
9127
9873
 
9128
9874
  if (type == 5
9129
9875
  || type == 28922
9876
+ || type == 28520
9877
+ || type == 30779
9878
+ || type == 30782
9130
9879
  )
9131
9880
  return HEAPU32;
9132
9881
 
@@ -9143,14 +9892,20 @@ var ASM_CONSTS = {
9143
9892
  return heap.subarray(toTypedArrayIndex(pixels, heap), toTypedArrayIndex(pixels + bytes, heap));
9144
9893
  };
9145
9894
 
9895
+
9896
+
9146
9897
  /** @suppress {duplicate } */
9147
9898
  var _glReadPixels = (x, y, width, height, format, type, pixels) => {
9148
- var pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, format);
9149
- if (!pixelData) {
9150
- GL.recordError(0x500/*GL_INVALID_ENUM*/);
9899
+ if (true) {
9900
+ if (GLctx.currentPixelPackBufferBinding) {
9901
+ GLctx.readPixels(x, y, width, height, format, type, pixels);
9902
+ return;
9903
+ }
9904
+ var heap = heapObjectForWebGLType(type);
9905
+ var target = toTypedArrayIndex(pixels, heap);
9906
+ GLctx.readPixels(x, y, width, height, format, type, heap, target);
9151
9907
  return;
9152
9908
  }
9153
- GLctx.readPixels(x, y, width, height, format, type, pixelData);
9154
9909
  };
9155
9910
  var _emscripten_glReadPixels = _glReadPixels;
9156
9911
 
@@ -9164,12 +9919,46 @@ var ASM_CONSTS = {
9164
9919
  var _glRenderbufferStorage = (x0, x1, x2, x3) => GLctx.renderbufferStorage(x0, x1, x2, x3);
9165
9920
  var _emscripten_glRenderbufferStorage = _glRenderbufferStorage;
9166
9921
 
9922
+ /** @suppress {duplicate } */
9923
+ var _glRenderbufferStorageMultisample = (x0, x1, x2, x3, x4) => GLctx.renderbufferStorageMultisample(x0, x1, x2, x3, x4);
9924
+ var _emscripten_glRenderbufferStorageMultisample = _glRenderbufferStorageMultisample;
9925
+
9926
+ /** @suppress {duplicate } */
9927
+ var _glResumeTransformFeedback = () => GLctx.resumeTransformFeedback();
9928
+ var _emscripten_glResumeTransformFeedback = _glResumeTransformFeedback;
9929
+
9167
9930
  /** @suppress {duplicate } */
9168
9931
  var _glSampleCoverage = (value, invert) => {
9169
9932
  GLctx.sampleCoverage(value, !!invert);
9170
9933
  };
9171
9934
  var _emscripten_glSampleCoverage = _glSampleCoverage;
9172
9935
 
9936
+ /** @suppress {duplicate } */
9937
+ var _glSamplerParameterf = (sampler, pname, param) => {
9938
+ GLctx.samplerParameterf(GL.samplers[sampler], pname, param);
9939
+ };
9940
+ var _emscripten_glSamplerParameterf = _glSamplerParameterf;
9941
+
9942
+ /** @suppress {duplicate } */
9943
+ var _glSamplerParameterfv = (sampler, pname, params) => {
9944
+ var param = HEAPF32[((params)>>2)];
9945
+ GLctx.samplerParameterf(GL.samplers[sampler], pname, param);
9946
+ };
9947
+ var _emscripten_glSamplerParameterfv = _glSamplerParameterfv;
9948
+
9949
+ /** @suppress {duplicate } */
9950
+ var _glSamplerParameteri = (sampler, pname, param) => {
9951
+ GLctx.samplerParameteri(GL.samplers[sampler], pname, param);
9952
+ };
9953
+ var _emscripten_glSamplerParameteri = _glSamplerParameteri;
9954
+
9955
+ /** @suppress {duplicate } */
9956
+ var _glSamplerParameteriv = (sampler, pname, params) => {
9957
+ var param = HEAP32[((params)>>2)];
9958
+ GLctx.samplerParameteri(GL.samplers[sampler], pname, param);
9959
+ };
9960
+ var _emscripten_glSamplerParameteriv = _glSamplerParameteriv;
9961
+
9173
9962
  /** @suppress {duplicate } */
9174
9963
  var _glScissor = (x0, x1, x2, x3) => GLctx.scissor(x0, x1, x2, x3);
9175
9964
  var _emscripten_glScissor = _glScissor;
@@ -9213,13 +10002,41 @@ var ASM_CONSTS = {
9213
10002
  var _emscripten_glStencilOpSeparate = _glStencilOpSeparate;
9214
10003
 
9215
10004
 
10005
+
10006
+
9216
10007
  /** @suppress {duplicate } */
9217
10008
  var _glTexImage2D = (target, level, internalFormat, width, height, border, format, type, pixels) => {
10009
+ if (true) {
10010
+ if (GLctx.currentPixelUnpackBufferBinding) {
10011
+ GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
10012
+ return;
10013
+ }
10014
+ if (pixels) {
10015
+ var heap = heapObjectForWebGLType(type);
10016
+ var index = toTypedArrayIndex(pixels, heap);
10017
+ GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, heap, index);
10018
+ return;
10019
+ }
10020
+ }
9218
10021
  var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat) : null;
9219
10022
  GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
9220
10023
  };
9221
10024
  var _emscripten_glTexImage2D = _glTexImage2D;
9222
10025
 
10026
+
10027
+ /** @suppress {duplicate } */
10028
+ var _glTexImage3D = (target, level, internalFormat, width, height, depth, border, format, type, pixels) => {
10029
+ if (GLctx.currentPixelUnpackBufferBinding) {
10030
+ GLctx.texImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels);
10031
+ } else if (pixels) {
10032
+ var heap = heapObjectForWebGLType(type);
10033
+ GLctx.texImage3D(target, level, internalFormat, width, height, depth, border, format, type, heap, toTypedArrayIndex(pixels, heap));
10034
+ } else {
10035
+ GLctx.texImage3D(target, level, internalFormat, width, height, depth, border, format, type, null);
10036
+ }
10037
+ };
10038
+ var _emscripten_glTexImage3D = _glTexImage3D;
10039
+
9223
10040
  /** @suppress {duplicate } */
9224
10041
  var _glTexParameterf = (x0, x1, x2) => GLctx.texParameterf(x0, x1, x2);
9225
10042
  var _emscripten_glTexParameterf = _glTexParameterf;
@@ -9242,15 +10059,61 @@ var ASM_CONSTS = {
9242
10059
  };
9243
10060
  var _emscripten_glTexParameteriv = _glTexParameteriv;
9244
10061
 
10062
+ /** @suppress {duplicate } */
10063
+ var _glTexStorage2D = (x0, x1, x2, x3, x4) => GLctx.texStorage2D(x0, x1, x2, x3, x4);
10064
+ var _emscripten_glTexStorage2D = _glTexStorage2D;
10065
+
10066
+ /** @suppress {duplicate } */
10067
+ var _glTexStorage3D = (x0, x1, x2, x3, x4, x5) => GLctx.texStorage3D(x0, x1, x2, x3, x4, x5);
10068
+ var _emscripten_glTexStorage3D = _glTexStorage3D;
10069
+
10070
+
10071
+
9245
10072
 
9246
10073
  /** @suppress {duplicate } */
9247
10074
  var _glTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, type, pixels) => {
10075
+ if (true) {
10076
+ if (GLctx.currentPixelUnpackBufferBinding) {
10077
+ GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
10078
+ return;
10079
+ }
10080
+ if (pixels) {
10081
+ var heap = heapObjectForWebGLType(type);
10082
+ GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, heap, toTypedArrayIndex(pixels, heap));
10083
+ return;
10084
+ }
10085
+ }
9248
10086
  var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, 0) : null;
9249
10087
  GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixelData);
9250
10088
  };
9251
10089
  var _emscripten_glTexSubImage2D = _glTexSubImage2D;
9252
10090
 
9253
10091
 
10092
+ /** @suppress {duplicate } */
10093
+ var _glTexSubImage3D = (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) => {
10094
+ if (GLctx.currentPixelUnpackBufferBinding) {
10095
+ GLctx.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
10096
+ } else if (pixels) {
10097
+ var heap = heapObjectForWebGLType(type);
10098
+ GLctx.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, heap, toTypedArrayIndex(pixels, heap));
10099
+ } else {
10100
+ GLctx.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, null);
10101
+ }
10102
+ };
10103
+ var _emscripten_glTexSubImage3D = _glTexSubImage3D;
10104
+
10105
+ /** @suppress {duplicate } */
10106
+ var _glTransformFeedbackVaryings = (program, count, varyings, bufferMode) => {
10107
+ program = GL.programs[program];
10108
+ var vars = [];
10109
+ for (var i = 0; i < count; i++)
10110
+ vars.push(UTF8ToString(HEAP32[(((varyings)+(i*4))>>2)]));
10111
+
10112
+ GLctx.transformFeedbackVaryings(program, vars, bufferMode);
10113
+ };
10114
+ var _emscripten_glTransformFeedbackVaryings = _glTransformFeedbackVaryings;
10115
+
10116
+
9254
10117
  /** @suppress {duplicate } */
9255
10118
  var _glUniform1f = (location, v0) => {
9256
10119
  GLctx.uniform1f(webglGetUniformLocation(location), v0);
@@ -9258,22 +10121,10 @@ var ASM_CONSTS = {
9258
10121
  var _emscripten_glUniform1f = _glUniform1f;
9259
10122
 
9260
10123
 
9261
- var miniTempWebGLFloatBuffers = [];
9262
-
9263
10124
  /** @suppress {duplicate } */
9264
10125
  var _glUniform1fv = (location, count, value) => {
9265
10126
 
9266
- if (count <= 288) {
9267
- // avoid allocation when uploading few enough uniforms
9268
- var view = miniTempWebGLFloatBuffers[count];
9269
- for (var i = 0; i < count; ++i) {
9270
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
9271
- }
9272
- } else
9273
- {
9274
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*4)>>2));
9275
- }
9276
- GLctx.uniform1fv(webglGetUniformLocation(location), view);
10127
+ count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, ((value)>>2), count);
9277
10128
  };
9278
10129
  var _emscripten_glUniform1fv = _glUniform1fv;
9279
10130
 
@@ -9285,25 +10136,25 @@ var ASM_CONSTS = {
9285
10136
  var _emscripten_glUniform1i = _glUniform1i;
9286
10137
 
9287
10138
 
9288
- var miniTempWebGLIntBuffers = [];
9289
-
9290
10139
  /** @suppress {duplicate } */
9291
10140
  var _glUniform1iv = (location, count, value) => {
9292
10141
 
9293
- if (count <= 288) {
9294
- // avoid allocation when uploading few enough uniforms
9295
- var view = miniTempWebGLIntBuffers[count];
9296
- for (var i = 0; i < count; ++i) {
9297
- view[i] = HEAP32[(((value)+(4*i))>>2)];
9298
- }
9299
- } else
9300
- {
9301
- var view = HEAP32.subarray((((value)>>2)), ((value+count*4)>>2));
9302
- }
9303
- GLctx.uniform1iv(webglGetUniformLocation(location), view);
10142
+ count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, ((value)>>2), count);
9304
10143
  };
9305
10144
  var _emscripten_glUniform1iv = _glUniform1iv;
9306
10145
 
10146
+ /** @suppress {duplicate } */
10147
+ var _glUniform1ui = (location, v0) => {
10148
+ GLctx.uniform1ui(webglGetUniformLocation(location), v0);
10149
+ };
10150
+ var _emscripten_glUniform1ui = _glUniform1ui;
10151
+
10152
+ /** @suppress {duplicate } */
10153
+ var _glUniform1uiv = (location, count, value) => {
10154
+ count && GLctx.uniform1uiv(webglGetUniformLocation(location), HEAPU32, ((value)>>2), count);
10155
+ };
10156
+ var _emscripten_glUniform1uiv = _glUniform1uiv;
10157
+
9307
10158
 
9308
10159
  /** @suppress {duplicate } */
9309
10160
  var _glUniform2f = (location, v0, v1) => {
@@ -9312,23 +10163,10 @@ var ASM_CONSTS = {
9312
10163
  var _emscripten_glUniform2f = _glUniform2f;
9313
10164
 
9314
10165
 
9315
-
9316
10166
  /** @suppress {duplicate } */
9317
10167
  var _glUniform2fv = (location, count, value) => {
9318
10168
 
9319
- if (count <= 144) {
9320
- // avoid allocation when uploading few enough uniforms
9321
- count *= 2;
9322
- var view = miniTempWebGLFloatBuffers[count];
9323
- for (var i = 0; i < count; i += 2) {
9324
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
9325
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
9326
- }
9327
- } else
9328
- {
9329
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*8)>>2));
9330
- }
9331
- GLctx.uniform2fv(webglGetUniformLocation(location), view);
10169
+ count && GLctx.uniform2fv(webglGetUniformLocation(location), HEAPF32, ((value)>>2), count*2);
9332
10170
  };
9333
10171
  var _emscripten_glUniform2fv = _glUniform2fv;
9334
10172
 
@@ -9340,26 +10178,25 @@ var ASM_CONSTS = {
9340
10178
  var _emscripten_glUniform2i = _glUniform2i;
9341
10179
 
9342
10180
 
9343
-
9344
10181
  /** @suppress {duplicate } */
9345
10182
  var _glUniform2iv = (location, count, value) => {
9346
10183
 
9347
- if (count <= 144) {
9348
- // avoid allocation when uploading few enough uniforms
9349
- count *= 2;
9350
- var view = miniTempWebGLIntBuffers[count];
9351
- for (var i = 0; i < count; i += 2) {
9352
- view[i] = HEAP32[(((value)+(4*i))>>2)];
9353
- view[i+1] = HEAP32[(((value)+(4*i+4))>>2)];
9354
- }
9355
- } else
9356
- {
9357
- var view = HEAP32.subarray((((value)>>2)), ((value+count*8)>>2));
9358
- }
9359
- GLctx.uniform2iv(webglGetUniformLocation(location), view);
10184
+ count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, ((value)>>2), count*2);
9360
10185
  };
9361
10186
  var _emscripten_glUniform2iv = _glUniform2iv;
9362
10187
 
10188
+ /** @suppress {duplicate } */
10189
+ var _glUniform2ui = (location, v0, v1) => {
10190
+ GLctx.uniform2ui(webglGetUniformLocation(location), v0, v1);
10191
+ };
10192
+ var _emscripten_glUniform2ui = _glUniform2ui;
10193
+
10194
+ /** @suppress {duplicate } */
10195
+ var _glUniform2uiv = (location, count, value) => {
10196
+ count && GLctx.uniform2uiv(webglGetUniformLocation(location), HEAPU32, ((value)>>2), count*2);
10197
+ };
10198
+ var _emscripten_glUniform2uiv = _glUniform2uiv;
10199
+
9363
10200
 
9364
10201
  /** @suppress {duplicate } */
9365
10202
  var _glUniform3f = (location, v0, v1, v2) => {
@@ -9368,24 +10205,10 @@ var ASM_CONSTS = {
9368
10205
  var _emscripten_glUniform3f = _glUniform3f;
9369
10206
 
9370
10207
 
9371
-
9372
10208
  /** @suppress {duplicate } */
9373
10209
  var _glUniform3fv = (location, count, value) => {
9374
10210
 
9375
- if (count <= 96) {
9376
- // avoid allocation when uploading few enough uniforms
9377
- count *= 3;
9378
- var view = miniTempWebGLFloatBuffers[count];
9379
- for (var i = 0; i < count; i += 3) {
9380
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
9381
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
9382
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
9383
- }
9384
- } else
9385
- {
9386
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*12)>>2));
9387
- }
9388
- GLctx.uniform3fv(webglGetUniformLocation(location), view);
10211
+ count && GLctx.uniform3fv(webglGetUniformLocation(location), HEAPF32, ((value)>>2), count*3);
9389
10212
  };
9390
10213
  var _emscripten_glUniform3fv = _glUniform3fv;
9391
10214
 
@@ -9397,27 +10220,25 @@ var ASM_CONSTS = {
9397
10220
  var _emscripten_glUniform3i = _glUniform3i;
9398
10221
 
9399
10222
 
9400
-
9401
10223
  /** @suppress {duplicate } */
9402
10224
  var _glUniform3iv = (location, count, value) => {
9403
10225
 
9404
- if (count <= 96) {
9405
- // avoid allocation when uploading few enough uniforms
9406
- count *= 3;
9407
- var view = miniTempWebGLIntBuffers[count];
9408
- for (var i = 0; i < count; i += 3) {
9409
- view[i] = HEAP32[(((value)+(4*i))>>2)];
9410
- view[i+1] = HEAP32[(((value)+(4*i+4))>>2)];
9411
- view[i+2] = HEAP32[(((value)+(4*i+8))>>2)];
9412
- }
9413
- } else
9414
- {
9415
- var view = HEAP32.subarray((((value)>>2)), ((value+count*12)>>2));
9416
- }
9417
- GLctx.uniform3iv(webglGetUniformLocation(location), view);
10226
+ count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, ((value)>>2), count*3);
9418
10227
  };
9419
10228
  var _emscripten_glUniform3iv = _glUniform3iv;
9420
10229
 
10230
+ /** @suppress {duplicate } */
10231
+ var _glUniform3ui = (location, v0, v1, v2) => {
10232
+ GLctx.uniform3ui(webglGetUniformLocation(location), v0, v1, v2);
10233
+ };
10234
+ var _emscripten_glUniform3ui = _glUniform3ui;
10235
+
10236
+ /** @suppress {duplicate } */
10237
+ var _glUniform3uiv = (location, count, value) => {
10238
+ count && GLctx.uniform3uiv(webglGetUniformLocation(location), HEAPU32, ((value)>>2), count*3);
10239
+ };
10240
+ var _emscripten_glUniform3uiv = _glUniform3uiv;
10241
+
9421
10242
 
9422
10243
  /** @suppress {duplicate } */
9423
10244
  var _glUniform4f = (location, v0, v1, v2, v3) => {
@@ -9426,29 +10247,10 @@ var ASM_CONSTS = {
9426
10247
  var _emscripten_glUniform4f = _glUniform4f;
9427
10248
 
9428
10249
 
9429
-
9430
10250
  /** @suppress {duplicate } */
9431
10251
  var _glUniform4fv = (location, count, value) => {
9432
10252
 
9433
- if (count <= 72) {
9434
- // avoid allocation when uploading few enough uniforms
9435
- var view = miniTempWebGLFloatBuffers[4*count];
9436
- // hoist the heap out of the loop for size and for pthreads+growth.
9437
- var heap = HEAPF32;
9438
- value = ((value)>>2);
9439
- count *= 4;
9440
- for (var i = 0; i < count; i += 4) {
9441
- var dst = value + i;
9442
- view[i] = heap[dst];
9443
- view[i + 1] = heap[dst + 1];
9444
- view[i + 2] = heap[dst + 2];
9445
- view[i + 3] = heap[dst + 3];
9446
- }
9447
- } else
9448
- {
9449
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*16)>>2));
9450
- }
9451
- GLctx.uniform4fv(webglGetUniformLocation(location), view);
10253
+ count && GLctx.uniform4fv(webglGetUniformLocation(location), HEAPF32, ((value)>>2), count*4);
9452
10254
  };
9453
10255
  var _emscripten_glUniform4fv = _glUniform4fv;
9454
10256
 
@@ -9460,118 +10262,93 @@ var ASM_CONSTS = {
9460
10262
  var _emscripten_glUniform4i = _glUniform4i;
9461
10263
 
9462
10264
 
9463
-
9464
10265
  /** @suppress {duplicate } */
9465
10266
  var _glUniform4iv = (location, count, value) => {
9466
10267
 
9467
- if (count <= 72) {
9468
- // avoid allocation when uploading few enough uniforms
9469
- count *= 4;
9470
- var view = miniTempWebGLIntBuffers[count];
9471
- for (var i = 0; i < count; i += 4) {
9472
- view[i] = HEAP32[(((value)+(4*i))>>2)];
9473
- view[i+1] = HEAP32[(((value)+(4*i+4))>>2)];
9474
- view[i+2] = HEAP32[(((value)+(4*i+8))>>2)];
9475
- view[i+3] = HEAP32[(((value)+(4*i+12))>>2)];
9476
- }
9477
- } else
9478
- {
9479
- var view = HEAP32.subarray((((value)>>2)), ((value+count*16)>>2));
9480
- }
9481
- GLctx.uniform4iv(webglGetUniformLocation(location), view);
10268
+ count && GLctx.uniform4iv(webglGetUniformLocation(location), HEAP32, ((value)>>2), count*4);
9482
10269
  };
9483
10270
  var _emscripten_glUniform4iv = _glUniform4iv;
9484
10271
 
10272
+ /** @suppress {duplicate } */
10273
+ var _glUniform4ui = (location, v0, v1, v2, v3) => {
10274
+ GLctx.uniform4ui(webglGetUniformLocation(location), v0, v1, v2, v3);
10275
+ };
10276
+ var _emscripten_glUniform4ui = _glUniform4ui;
10277
+
10278
+ /** @suppress {duplicate } */
10279
+ var _glUniform4uiv = (location, count, value) => {
10280
+ count && GLctx.uniform4uiv(webglGetUniformLocation(location), HEAPU32, ((value)>>2), count*4);
10281
+ };
10282
+ var _emscripten_glUniform4uiv = _glUniform4uiv;
10283
+
10284
+ /** @suppress {duplicate } */
10285
+ var _glUniformBlockBinding = (program, uniformBlockIndex, uniformBlockBinding) => {
10286
+ program = GL.programs[program];
9485
10287
 
10288
+ GLctx.uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
10289
+ };
10290
+ var _emscripten_glUniformBlockBinding = _glUniformBlockBinding;
10291
+
9486
10292
 
9487
10293
  /** @suppress {duplicate } */
9488
10294
  var _glUniformMatrix2fv = (location, count, transpose, value) => {
9489
10295
 
9490
- if (count <= 72) {
9491
- // avoid allocation when uploading few enough uniforms
9492
- count *= 4;
9493
- var view = miniTempWebGLFloatBuffers[count];
9494
- for (var i = 0; i < count; i += 4) {
9495
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
9496
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
9497
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
9498
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
9499
- }
9500
- } else
9501
- {
9502
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*16)>>2));
9503
- }
9504
- GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, view);
10296
+ count && GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*4);
9505
10297
  };
9506
10298
  var _emscripten_glUniformMatrix2fv = _glUniformMatrix2fv;
9507
10299
 
9508
-
10300
+ /** @suppress {duplicate } */
10301
+ var _glUniformMatrix2x3fv = (location, count, transpose, value) => {
10302
+ count && GLctx.uniformMatrix2x3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*6);
10303
+ };
10304
+ var _emscripten_glUniformMatrix2x3fv = _glUniformMatrix2x3fv;
10305
+
10306
+ /** @suppress {duplicate } */
10307
+ var _glUniformMatrix2x4fv = (location, count, transpose, value) => {
10308
+ count && GLctx.uniformMatrix2x4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*8);
10309
+ };
10310
+ var _emscripten_glUniformMatrix2x4fv = _glUniformMatrix2x4fv;
10311
+
9509
10312
 
9510
10313
  /** @suppress {duplicate } */
9511
10314
  var _glUniformMatrix3fv = (location, count, transpose, value) => {
9512
10315
 
9513
- if (count <= 32) {
9514
- // avoid allocation when uploading few enough uniforms
9515
- count *= 9;
9516
- var view = miniTempWebGLFloatBuffers[count];
9517
- for (var i = 0; i < count; i += 9) {
9518
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
9519
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
9520
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
9521
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
9522
- view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
9523
- view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
9524
- view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
9525
- view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
9526
- view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
9527
- }
9528
- } else
9529
- {
9530
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*36)>>2));
9531
- }
9532
- GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, view);
10316
+ count && GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*9);
9533
10317
  };
9534
10318
  var _emscripten_glUniformMatrix3fv = _glUniformMatrix3fv;
9535
10319
 
9536
-
10320
+ /** @suppress {duplicate } */
10321
+ var _glUniformMatrix3x2fv = (location, count, transpose, value) => {
10322
+ count && GLctx.uniformMatrix3x2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*6);
10323
+ };
10324
+ var _emscripten_glUniformMatrix3x2fv = _glUniformMatrix3x2fv;
10325
+
10326
+ /** @suppress {duplicate } */
10327
+ var _glUniformMatrix3x4fv = (location, count, transpose, value) => {
10328
+ count && GLctx.uniformMatrix3x4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*12);
10329
+ };
10330
+ var _emscripten_glUniformMatrix3x4fv = _glUniformMatrix3x4fv;
10331
+
9537
10332
 
9538
10333
  /** @suppress {duplicate } */
9539
10334
  var _glUniformMatrix4fv = (location, count, transpose, value) => {
9540
10335
 
9541
- if (count <= 18) {
9542
- // avoid allocation when uploading few enough uniforms
9543
- var view = miniTempWebGLFloatBuffers[16*count];
9544
- // hoist the heap out of the loop for size and for pthreads+growth.
9545
- var heap = HEAPF32;
9546
- value = ((value)>>2);
9547
- count *= 16;
9548
- for (var i = 0; i < count; i += 16) {
9549
- var dst = value + i;
9550
- view[i] = heap[dst];
9551
- view[i + 1] = heap[dst + 1];
9552
- view[i + 2] = heap[dst + 2];
9553
- view[i + 3] = heap[dst + 3];
9554
- view[i + 4] = heap[dst + 4];
9555
- view[i + 5] = heap[dst + 5];
9556
- view[i + 6] = heap[dst + 6];
9557
- view[i + 7] = heap[dst + 7];
9558
- view[i + 8] = heap[dst + 8];
9559
- view[i + 9] = heap[dst + 9];
9560
- view[i + 10] = heap[dst + 10];
9561
- view[i + 11] = heap[dst + 11];
9562
- view[i + 12] = heap[dst + 12];
9563
- view[i + 13] = heap[dst + 13];
9564
- view[i + 14] = heap[dst + 14];
9565
- view[i + 15] = heap[dst + 15];
9566
- }
9567
- } else
9568
- {
9569
- var view = HEAPF32.subarray((((value)>>2)), ((value+count*64)>>2));
9570
- }
9571
- GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, view);
10336
+ count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*16);
9572
10337
  };
9573
10338
  var _emscripten_glUniformMatrix4fv = _glUniformMatrix4fv;
9574
10339
 
10340
+ /** @suppress {duplicate } */
10341
+ var _glUniformMatrix4x2fv = (location, count, transpose, value) => {
10342
+ count && GLctx.uniformMatrix4x2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*8);
10343
+ };
10344
+ var _emscripten_glUniformMatrix4x2fv = _glUniformMatrix4x2fv;
10345
+
10346
+ /** @suppress {duplicate } */
10347
+ var _glUniformMatrix4x3fv = (location, count, transpose, value) => {
10348
+ count && GLctx.uniformMatrix4x3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, ((value)>>2), count*12);
10349
+ };
10350
+ var _emscripten_glUniformMatrix4x3fv = _glUniformMatrix4x3fv;
10351
+
9575
10352
  /** @suppress {duplicate } */
9576
10353
  var _glUseProgram = (program) => {
9577
10354
  program = GL.programs[program];
@@ -9632,15 +10409,58 @@ var ASM_CONSTS = {
9632
10409
  };
9633
10410
  var _emscripten_glVertexAttrib4fv = _glVertexAttrib4fv;
9634
10411
 
9635
-
9636
10412
  /** @suppress {duplicate } */
9637
10413
  var _glVertexAttribDivisor = (index, divisor) => {
9638
10414
  GLctx.vertexAttribDivisor(index, divisor);
9639
10415
  };
10416
+ var _emscripten_glVertexAttribDivisor = _glVertexAttribDivisor;
10417
+
10418
+
9640
10419
  /** @suppress {duplicate } */
9641
10420
  var _glVertexAttribDivisorANGLE = _glVertexAttribDivisor;
9642
10421
  var _emscripten_glVertexAttribDivisorANGLE = _glVertexAttribDivisorANGLE;
9643
10422
 
10423
+
10424
+ /** @suppress {duplicate } */
10425
+ var _glVertexAttribDivisorARB = _glVertexAttribDivisor;
10426
+ var _emscripten_glVertexAttribDivisorARB = _glVertexAttribDivisorARB;
10427
+
10428
+
10429
+ /** @suppress {duplicate } */
10430
+ var _glVertexAttribDivisorEXT = _glVertexAttribDivisor;
10431
+ var _emscripten_glVertexAttribDivisorEXT = _glVertexAttribDivisorEXT;
10432
+
10433
+
10434
+ /** @suppress {duplicate } */
10435
+ var _glVertexAttribDivisorNV = _glVertexAttribDivisor;
10436
+ var _emscripten_glVertexAttribDivisorNV = _glVertexAttribDivisorNV;
10437
+
10438
+ /** @suppress {duplicate } */
10439
+ var _glVertexAttribI4i = (x0, x1, x2, x3, x4) => GLctx.vertexAttribI4i(x0, x1, x2, x3, x4);
10440
+ var _emscripten_glVertexAttribI4i = _glVertexAttribI4i;
10441
+
10442
+ /** @suppress {duplicate } */
10443
+ var _glVertexAttribI4iv = (index, v) => {
10444
+ GLctx.vertexAttribI4i(index, HEAP32[v>>2], HEAP32[v+4>>2], HEAP32[v+8>>2], HEAP32[v+12>>2]);
10445
+ };
10446
+ var _emscripten_glVertexAttribI4iv = _glVertexAttribI4iv;
10447
+
10448
+ /** @suppress {duplicate } */
10449
+ var _glVertexAttribI4ui = (x0, x1, x2, x3, x4) => GLctx.vertexAttribI4ui(x0, x1, x2, x3, x4);
10450
+ var _emscripten_glVertexAttribI4ui = _glVertexAttribI4ui;
10451
+
10452
+ /** @suppress {duplicate } */
10453
+ var _glVertexAttribI4uiv = (index, v) => {
10454
+ GLctx.vertexAttribI4ui(index, HEAPU32[v>>2], HEAPU32[v+4>>2], HEAPU32[v+8>>2], HEAPU32[v+12>>2]);
10455
+ };
10456
+ var _emscripten_glVertexAttribI4uiv = _glVertexAttribI4uiv;
10457
+
10458
+ /** @suppress {duplicate } */
10459
+ var _glVertexAttribIPointer = (index, size, type, stride, ptr) => {
10460
+ GLctx.vertexAttribIPointer(index, size, type, stride, ptr);
10461
+ };
10462
+ var _emscripten_glVertexAttribIPointer = _glVertexAttribIPointer;
10463
+
9644
10464
  /** @suppress {duplicate } */
9645
10465
  var _glVertexAttribPointer = (index, size, type, normalized, stride, ptr) => {
9646
10466
  GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
@@ -9651,6 +10471,14 @@ var ASM_CONSTS = {
9651
10471
  var _glViewport = (x0, x1, x2, x3) => GLctx.viewport(x0, x1, x2, x3);
9652
10472
  var _emscripten_glViewport = _glViewport;
9653
10473
 
10474
+ /** @suppress {duplicate } */
10475
+ var _glWaitSync = (sync, flags, timeout) => {
10476
+ // See WebGL2 vs GLES3 difference on GL_TIMEOUT_IGNORED above (https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.15)
10477
+ timeout = Number(timeout);
10478
+ GLctx.waitSync(GL.syncs[sync], flags, timeout);
10479
+ };
10480
+ var _emscripten_glWaitSync = _glWaitSync;
10481
+
9654
10482
  var _emscripten_has_asyncify = () => 0;
9655
10483
 
9656
10484
  var _emscripten_pause_main_loop = () => MainLoop.pause();
@@ -11093,16 +11921,6 @@ PThread.init();;
11093
11921
  Module['resumeMainLoop'] = MainLoop.resume;
11094
11922
  MainLoop.init();;
11095
11923
  for (var i = 0; i < 32; ++i) tempFixedLengthArray.push(new Array(i));;
11096
- var miniTempWebGLFloatBuffersStorage = new Float32Array(288);
11097
- // Create GL_POOL_TEMP_BUFFERS_SIZE+1 temporary buffers, for uploads of size 0 through GL_POOL_TEMP_BUFFERS_SIZE inclusive
11098
- for (/**@suppress{duplicate}*/var i = 0; i <= 288; ++i) {
11099
- miniTempWebGLFloatBuffers[i] = miniTempWebGLFloatBuffersStorage.subarray(0, i);
11100
- };
11101
- var miniTempWebGLIntBuffersStorage = new Int32Array(288);
11102
- // Create GL_POOL_TEMP_BUFFERS_SIZE+1 temporary buffers, for uploads of size 0 through GL_POOL_TEMP_BUFFERS_SIZE inclusive
11103
- for (/**@suppress{duplicate}*/var i = 0; i <= 288; ++i) {
11104
- miniTempWebGLIntBuffers[i] = miniTempWebGLIntBuffersStorage.subarray(0, i);
11105
- };
11106
11924
 
11107
11925
  // proxiedFunctionTable specifies the list of functions that can be called
11108
11926
  // either synchronously or asynchronously from other threads in postMessage()d
@@ -11337,18 +12155,32 @@ function assignWasmImports() {
11337
12155
  /** @export */
11338
12156
  emscripten_glAttachShader: _emscripten_glAttachShader,
11339
12157
  /** @export */
12158
+ emscripten_glBeginQuery: _emscripten_glBeginQuery,
12159
+ /** @export */
11340
12160
  emscripten_glBeginQueryEXT: _emscripten_glBeginQueryEXT,
11341
12161
  /** @export */
12162
+ emscripten_glBeginTransformFeedback: _emscripten_glBeginTransformFeedback,
12163
+ /** @export */
11342
12164
  emscripten_glBindAttribLocation: _emscripten_glBindAttribLocation,
11343
12165
  /** @export */
11344
12166
  emscripten_glBindBuffer: _emscripten_glBindBuffer,
11345
12167
  /** @export */
12168
+ emscripten_glBindBufferBase: _emscripten_glBindBufferBase,
12169
+ /** @export */
12170
+ emscripten_glBindBufferRange: _emscripten_glBindBufferRange,
12171
+ /** @export */
11346
12172
  emscripten_glBindFramebuffer: _emscripten_glBindFramebuffer,
11347
12173
  /** @export */
11348
12174
  emscripten_glBindRenderbuffer: _emscripten_glBindRenderbuffer,
11349
12175
  /** @export */
12176
+ emscripten_glBindSampler: _emscripten_glBindSampler,
12177
+ /** @export */
11350
12178
  emscripten_glBindTexture: _emscripten_glBindTexture,
11351
12179
  /** @export */
12180
+ emscripten_glBindTransformFeedback: _emscripten_glBindTransformFeedback,
12181
+ /** @export */
12182
+ emscripten_glBindVertexArray: _emscripten_glBindVertexArray,
12183
+ /** @export */
11352
12184
  emscripten_glBindVertexArrayOES: _emscripten_glBindVertexArrayOES,
11353
12185
  /** @export */
11354
12186
  emscripten_glBlendColor: _emscripten_glBlendColor,
@@ -11361,6 +12193,8 @@ function assignWasmImports() {
11361
12193
  /** @export */
11362
12194
  emscripten_glBlendFuncSeparate: _emscripten_glBlendFuncSeparate,
11363
12195
  /** @export */
12196
+ emscripten_glBlitFramebuffer: _emscripten_glBlitFramebuffer,
12197
+ /** @export */
11364
12198
  emscripten_glBufferData: _emscripten_glBufferData,
11365
12199
  /** @export */
11366
12200
  emscripten_glBufferSubData: _emscripten_glBufferSubData,
@@ -11369,12 +12203,22 @@ function assignWasmImports() {
11369
12203
  /** @export */
11370
12204
  emscripten_glClear: _emscripten_glClear,
11371
12205
  /** @export */
12206
+ emscripten_glClearBufferfi: _emscripten_glClearBufferfi,
12207
+ /** @export */
12208
+ emscripten_glClearBufferfv: _emscripten_glClearBufferfv,
12209
+ /** @export */
12210
+ emscripten_glClearBufferiv: _emscripten_glClearBufferiv,
12211
+ /** @export */
12212
+ emscripten_glClearBufferuiv: _emscripten_glClearBufferuiv,
12213
+ /** @export */
11372
12214
  emscripten_glClearColor: _emscripten_glClearColor,
11373
12215
  /** @export */
11374
12216
  emscripten_glClearDepthf: _emscripten_glClearDepthf,
11375
12217
  /** @export */
11376
12218
  emscripten_glClearStencil: _emscripten_glClearStencil,
11377
12219
  /** @export */
12220
+ emscripten_glClientWaitSync: _emscripten_glClientWaitSync,
12221
+ /** @export */
11378
12222
  emscripten_glClipControlEXT: _emscripten_glClipControlEXT,
11379
12223
  /** @export */
11380
12224
  emscripten_glColorMask: _emscripten_glColorMask,
@@ -11383,12 +12227,20 @@ function assignWasmImports() {
11383
12227
  /** @export */
11384
12228
  emscripten_glCompressedTexImage2D: _emscripten_glCompressedTexImage2D,
11385
12229
  /** @export */
12230
+ emscripten_glCompressedTexImage3D: _emscripten_glCompressedTexImage3D,
12231
+ /** @export */
11386
12232
  emscripten_glCompressedTexSubImage2D: _emscripten_glCompressedTexSubImage2D,
11387
12233
  /** @export */
12234
+ emscripten_glCompressedTexSubImage3D: _emscripten_glCompressedTexSubImage3D,
12235
+ /** @export */
12236
+ emscripten_glCopyBufferSubData: _emscripten_glCopyBufferSubData,
12237
+ /** @export */
11388
12238
  emscripten_glCopyTexImage2D: _emscripten_glCopyTexImage2D,
11389
12239
  /** @export */
11390
12240
  emscripten_glCopyTexSubImage2D: _emscripten_glCopyTexSubImage2D,
11391
12241
  /** @export */
12242
+ emscripten_glCopyTexSubImage3D: _emscripten_glCopyTexSubImage3D,
12243
+ /** @export */
11392
12244
  emscripten_glCreateProgram: _emscripten_glCreateProgram,
11393
12245
  /** @export */
11394
12246
  emscripten_glCreateShader: _emscripten_glCreateShader,
@@ -11401,14 +12253,24 @@ function assignWasmImports() {
11401
12253
  /** @export */
11402
12254
  emscripten_glDeleteProgram: _emscripten_glDeleteProgram,
11403
12255
  /** @export */
12256
+ emscripten_glDeleteQueries: _emscripten_glDeleteQueries,
12257
+ /** @export */
11404
12258
  emscripten_glDeleteQueriesEXT: _emscripten_glDeleteQueriesEXT,
11405
12259
  /** @export */
11406
12260
  emscripten_glDeleteRenderbuffers: _emscripten_glDeleteRenderbuffers,
11407
12261
  /** @export */
12262
+ emscripten_glDeleteSamplers: _emscripten_glDeleteSamplers,
12263
+ /** @export */
11408
12264
  emscripten_glDeleteShader: _emscripten_glDeleteShader,
11409
12265
  /** @export */
12266
+ emscripten_glDeleteSync: _emscripten_glDeleteSync,
12267
+ /** @export */
11410
12268
  emscripten_glDeleteTextures: _emscripten_glDeleteTextures,
11411
12269
  /** @export */
12270
+ emscripten_glDeleteTransformFeedbacks: _emscripten_glDeleteTransformFeedbacks,
12271
+ /** @export */
12272
+ emscripten_glDeleteVertexArrays: _emscripten_glDeleteVertexArrays,
12273
+ /** @export */
11412
12274
  emscripten_glDeleteVertexArraysOES: _emscripten_glDeleteVertexArraysOES,
11413
12275
  /** @export */
11414
12276
  emscripten_glDepthFunc: _emscripten_glDepthFunc,
@@ -11425,20 +12287,48 @@ function assignWasmImports() {
11425
12287
  /** @export */
11426
12288
  emscripten_glDrawArrays: _emscripten_glDrawArrays,
11427
12289
  /** @export */
12290
+ emscripten_glDrawArraysInstanced: _emscripten_glDrawArraysInstanced,
12291
+ /** @export */
11428
12292
  emscripten_glDrawArraysInstancedANGLE: _emscripten_glDrawArraysInstancedANGLE,
11429
12293
  /** @export */
12294
+ emscripten_glDrawArraysInstancedARB: _emscripten_glDrawArraysInstancedARB,
12295
+ /** @export */
12296
+ emscripten_glDrawArraysInstancedEXT: _emscripten_glDrawArraysInstancedEXT,
12297
+ /** @export */
12298
+ emscripten_glDrawArraysInstancedNV: _emscripten_glDrawArraysInstancedNV,
12299
+ /** @export */
12300
+ emscripten_glDrawBuffers: _emscripten_glDrawBuffers,
12301
+ /** @export */
12302
+ emscripten_glDrawBuffersEXT: _emscripten_glDrawBuffersEXT,
12303
+ /** @export */
11430
12304
  emscripten_glDrawBuffersWEBGL: _emscripten_glDrawBuffersWEBGL,
11431
12305
  /** @export */
11432
12306
  emscripten_glDrawElements: _emscripten_glDrawElements,
11433
12307
  /** @export */
12308
+ emscripten_glDrawElementsInstanced: _emscripten_glDrawElementsInstanced,
12309
+ /** @export */
11434
12310
  emscripten_glDrawElementsInstancedANGLE: _emscripten_glDrawElementsInstancedANGLE,
11435
12311
  /** @export */
12312
+ emscripten_glDrawElementsInstancedARB: _emscripten_glDrawElementsInstancedARB,
12313
+ /** @export */
12314
+ emscripten_glDrawElementsInstancedEXT: _emscripten_glDrawElementsInstancedEXT,
12315
+ /** @export */
12316
+ emscripten_glDrawElementsInstancedNV: _emscripten_glDrawElementsInstancedNV,
12317
+ /** @export */
12318
+ emscripten_glDrawRangeElements: _emscripten_glDrawRangeElements,
12319
+ /** @export */
11436
12320
  emscripten_glEnable: _emscripten_glEnable,
11437
12321
  /** @export */
11438
12322
  emscripten_glEnableVertexAttribArray: _emscripten_glEnableVertexAttribArray,
11439
12323
  /** @export */
12324
+ emscripten_glEndQuery: _emscripten_glEndQuery,
12325
+ /** @export */
11440
12326
  emscripten_glEndQueryEXT: _emscripten_glEndQueryEXT,
11441
12327
  /** @export */
12328
+ emscripten_glEndTransformFeedback: _emscripten_glEndTransformFeedback,
12329
+ /** @export */
12330
+ emscripten_glFenceSync: _emscripten_glFenceSync,
12331
+ /** @export */
11442
12332
  emscripten_glFinish: _emscripten_glFinish,
11443
12333
  /** @export */
11444
12334
  emscripten_glFlush: _emscripten_glFlush,
@@ -11447,18 +12337,28 @@ function assignWasmImports() {
11447
12337
  /** @export */
11448
12338
  emscripten_glFramebufferTexture2D: _emscripten_glFramebufferTexture2D,
11449
12339
  /** @export */
12340
+ emscripten_glFramebufferTextureLayer: _emscripten_glFramebufferTextureLayer,
12341
+ /** @export */
11450
12342
  emscripten_glFrontFace: _emscripten_glFrontFace,
11451
12343
  /** @export */
11452
12344
  emscripten_glGenBuffers: _emscripten_glGenBuffers,
11453
12345
  /** @export */
11454
12346
  emscripten_glGenFramebuffers: _emscripten_glGenFramebuffers,
11455
12347
  /** @export */
12348
+ emscripten_glGenQueries: _emscripten_glGenQueries,
12349
+ /** @export */
11456
12350
  emscripten_glGenQueriesEXT: _emscripten_glGenQueriesEXT,
11457
12351
  /** @export */
11458
12352
  emscripten_glGenRenderbuffers: _emscripten_glGenRenderbuffers,
11459
12353
  /** @export */
12354
+ emscripten_glGenSamplers: _emscripten_glGenSamplers,
12355
+ /** @export */
11460
12356
  emscripten_glGenTextures: _emscripten_glGenTextures,
11461
12357
  /** @export */
12358
+ emscripten_glGenTransformFeedbacks: _emscripten_glGenTransformFeedbacks,
12359
+ /** @export */
12360
+ emscripten_glGenVertexArrays: _emscripten_glGenVertexArrays,
12361
+ /** @export */
11462
12362
  emscripten_glGenVertexArraysOES: _emscripten_glGenVertexArraysOES,
11463
12363
  /** @export */
11464
12364
  emscripten_glGenerateMipmap: _emscripten_glGenerateMipmap,
@@ -11467,22 +12367,42 @@ function assignWasmImports() {
11467
12367
  /** @export */
11468
12368
  emscripten_glGetActiveUniform: _emscripten_glGetActiveUniform,
11469
12369
  /** @export */
12370
+ emscripten_glGetActiveUniformBlockName: _emscripten_glGetActiveUniformBlockName,
12371
+ /** @export */
12372
+ emscripten_glGetActiveUniformBlockiv: _emscripten_glGetActiveUniformBlockiv,
12373
+ /** @export */
12374
+ emscripten_glGetActiveUniformsiv: _emscripten_glGetActiveUniformsiv,
12375
+ /** @export */
11470
12376
  emscripten_glGetAttachedShaders: _emscripten_glGetAttachedShaders,
11471
12377
  /** @export */
11472
12378
  emscripten_glGetAttribLocation: _emscripten_glGetAttribLocation,
11473
12379
  /** @export */
11474
12380
  emscripten_glGetBooleanv: _emscripten_glGetBooleanv,
11475
12381
  /** @export */
12382
+ emscripten_glGetBufferParameteri64v: _emscripten_glGetBufferParameteri64v,
12383
+ /** @export */
11476
12384
  emscripten_glGetBufferParameteriv: _emscripten_glGetBufferParameteriv,
11477
12385
  /** @export */
11478
12386
  emscripten_glGetError: _emscripten_glGetError,
11479
12387
  /** @export */
11480
12388
  emscripten_glGetFloatv: _emscripten_glGetFloatv,
11481
12389
  /** @export */
12390
+ emscripten_glGetFragDataLocation: _emscripten_glGetFragDataLocation,
12391
+ /** @export */
11482
12392
  emscripten_glGetFramebufferAttachmentParameteriv: _emscripten_glGetFramebufferAttachmentParameteriv,
11483
12393
  /** @export */
12394
+ emscripten_glGetInteger64i_v: _emscripten_glGetInteger64i_v,
12395
+ /** @export */
12396
+ emscripten_glGetInteger64v: _emscripten_glGetInteger64v,
12397
+ /** @export */
12398
+ emscripten_glGetIntegeri_v: _emscripten_glGetIntegeri_v,
12399
+ /** @export */
11484
12400
  emscripten_glGetIntegerv: _emscripten_glGetIntegerv,
11485
12401
  /** @export */
12402
+ emscripten_glGetInternalformativ: _emscripten_glGetInternalformativ,
12403
+ /** @export */
12404
+ emscripten_glGetProgramBinary: _emscripten_glGetProgramBinary,
12405
+ /** @export */
11486
12406
  emscripten_glGetProgramInfoLog: _emscripten_glGetProgramInfoLog,
11487
12407
  /** @export */
11488
12408
  emscripten_glGetProgramiv: _emscripten_glGetProgramiv,
@@ -11493,12 +12413,20 @@ function assignWasmImports() {
11493
12413
  /** @export */
11494
12414
  emscripten_glGetQueryObjectui64vEXT: _emscripten_glGetQueryObjectui64vEXT,
11495
12415
  /** @export */
12416
+ emscripten_glGetQueryObjectuiv: _emscripten_glGetQueryObjectuiv,
12417
+ /** @export */
11496
12418
  emscripten_glGetQueryObjectuivEXT: _emscripten_glGetQueryObjectuivEXT,
11497
12419
  /** @export */
12420
+ emscripten_glGetQueryiv: _emscripten_glGetQueryiv,
12421
+ /** @export */
11498
12422
  emscripten_glGetQueryivEXT: _emscripten_glGetQueryivEXT,
11499
12423
  /** @export */
11500
12424
  emscripten_glGetRenderbufferParameteriv: _emscripten_glGetRenderbufferParameteriv,
11501
12425
  /** @export */
12426
+ emscripten_glGetSamplerParameterfv: _emscripten_glGetSamplerParameterfv,
12427
+ /** @export */
12428
+ emscripten_glGetSamplerParameteriv: _emscripten_glGetSamplerParameteriv,
12429
+ /** @export */
11502
12430
  emscripten_glGetShaderInfoLog: _emscripten_glGetShaderInfoLog,
11503
12431
  /** @export */
11504
12432
  emscripten_glGetShaderPrecisionFormat: _emscripten_glGetShaderPrecisionFormat,
@@ -11509,16 +12437,32 @@ function assignWasmImports() {
11509
12437
  /** @export */
11510
12438
  emscripten_glGetString: _emscripten_glGetString,
11511
12439
  /** @export */
12440
+ emscripten_glGetStringi: _emscripten_glGetStringi,
12441
+ /** @export */
12442
+ emscripten_glGetSynciv: _emscripten_glGetSynciv,
12443
+ /** @export */
11512
12444
  emscripten_glGetTexParameterfv: _emscripten_glGetTexParameterfv,
11513
12445
  /** @export */
11514
12446
  emscripten_glGetTexParameteriv: _emscripten_glGetTexParameteriv,
11515
12447
  /** @export */
12448
+ emscripten_glGetTransformFeedbackVarying: _emscripten_glGetTransformFeedbackVarying,
12449
+ /** @export */
12450
+ emscripten_glGetUniformBlockIndex: _emscripten_glGetUniformBlockIndex,
12451
+ /** @export */
12452
+ emscripten_glGetUniformIndices: _emscripten_glGetUniformIndices,
12453
+ /** @export */
11516
12454
  emscripten_glGetUniformLocation: _emscripten_glGetUniformLocation,
11517
12455
  /** @export */
11518
12456
  emscripten_glGetUniformfv: _emscripten_glGetUniformfv,
11519
12457
  /** @export */
11520
12458
  emscripten_glGetUniformiv: _emscripten_glGetUniformiv,
11521
12459
  /** @export */
12460
+ emscripten_glGetUniformuiv: _emscripten_glGetUniformuiv,
12461
+ /** @export */
12462
+ emscripten_glGetVertexAttribIiv: _emscripten_glGetVertexAttribIiv,
12463
+ /** @export */
12464
+ emscripten_glGetVertexAttribIuiv: _emscripten_glGetVertexAttribIuiv,
12465
+ /** @export */
11522
12466
  emscripten_glGetVertexAttribPointerv: _emscripten_glGetVertexAttribPointerv,
11523
12467
  /** @export */
11524
12468
  emscripten_glGetVertexAttribfv: _emscripten_glGetVertexAttribfv,
@@ -11527,6 +12471,10 @@ function assignWasmImports() {
11527
12471
  /** @export */
11528
12472
  emscripten_glHint: _emscripten_glHint,
11529
12473
  /** @export */
12474
+ emscripten_glInvalidateFramebuffer: _emscripten_glInvalidateFramebuffer,
12475
+ /** @export */
12476
+ emscripten_glInvalidateSubFramebuffer: _emscripten_glInvalidateSubFramebuffer,
12477
+ /** @export */
11530
12478
  emscripten_glIsBuffer: _emscripten_glIsBuffer,
11531
12479
  /** @export */
11532
12480
  emscripten_glIsEnabled: _emscripten_glIsEnabled,
@@ -11535,20 +12483,32 @@ function assignWasmImports() {
11535
12483
  /** @export */
11536
12484
  emscripten_glIsProgram: _emscripten_glIsProgram,
11537
12485
  /** @export */
12486
+ emscripten_glIsQuery: _emscripten_glIsQuery,
12487
+ /** @export */
11538
12488
  emscripten_glIsQueryEXT: _emscripten_glIsQueryEXT,
11539
12489
  /** @export */
11540
12490
  emscripten_glIsRenderbuffer: _emscripten_glIsRenderbuffer,
11541
12491
  /** @export */
12492
+ emscripten_glIsSampler: _emscripten_glIsSampler,
12493
+ /** @export */
11542
12494
  emscripten_glIsShader: _emscripten_glIsShader,
11543
12495
  /** @export */
12496
+ emscripten_glIsSync: _emscripten_glIsSync,
12497
+ /** @export */
11544
12498
  emscripten_glIsTexture: _emscripten_glIsTexture,
11545
12499
  /** @export */
12500
+ emscripten_glIsTransformFeedback: _emscripten_glIsTransformFeedback,
12501
+ /** @export */
12502
+ emscripten_glIsVertexArray: _emscripten_glIsVertexArray,
12503
+ /** @export */
11546
12504
  emscripten_glIsVertexArrayOES: _emscripten_glIsVertexArrayOES,
11547
12505
  /** @export */
11548
12506
  emscripten_glLineWidth: _emscripten_glLineWidth,
11549
12507
  /** @export */
11550
12508
  emscripten_glLinkProgram: _emscripten_glLinkProgram,
11551
12509
  /** @export */
12510
+ emscripten_glPauseTransformFeedback: _emscripten_glPauseTransformFeedback,
12511
+ /** @export */
11552
12512
  emscripten_glPixelStorei: _emscripten_glPixelStorei,
11553
12513
  /** @export */
11554
12514
  emscripten_glPolygonModeWEBGL: _emscripten_glPolygonModeWEBGL,
@@ -11557,16 +12517,34 @@ function assignWasmImports() {
11557
12517
  /** @export */
11558
12518
  emscripten_glPolygonOffsetClampEXT: _emscripten_glPolygonOffsetClampEXT,
11559
12519
  /** @export */
12520
+ emscripten_glProgramBinary: _emscripten_glProgramBinary,
12521
+ /** @export */
12522
+ emscripten_glProgramParameteri: _emscripten_glProgramParameteri,
12523
+ /** @export */
11560
12524
  emscripten_glQueryCounterEXT: _emscripten_glQueryCounterEXT,
11561
12525
  /** @export */
12526
+ emscripten_glReadBuffer: _emscripten_glReadBuffer,
12527
+ /** @export */
11562
12528
  emscripten_glReadPixels: _emscripten_glReadPixels,
11563
12529
  /** @export */
11564
12530
  emscripten_glReleaseShaderCompiler: _emscripten_glReleaseShaderCompiler,
11565
12531
  /** @export */
11566
12532
  emscripten_glRenderbufferStorage: _emscripten_glRenderbufferStorage,
11567
12533
  /** @export */
12534
+ emscripten_glRenderbufferStorageMultisample: _emscripten_glRenderbufferStorageMultisample,
12535
+ /** @export */
12536
+ emscripten_glResumeTransformFeedback: _emscripten_glResumeTransformFeedback,
12537
+ /** @export */
11568
12538
  emscripten_glSampleCoverage: _emscripten_glSampleCoverage,
11569
12539
  /** @export */
12540
+ emscripten_glSamplerParameterf: _emscripten_glSamplerParameterf,
12541
+ /** @export */
12542
+ emscripten_glSamplerParameterfv: _emscripten_glSamplerParameterfv,
12543
+ /** @export */
12544
+ emscripten_glSamplerParameteri: _emscripten_glSamplerParameteri,
12545
+ /** @export */
12546
+ emscripten_glSamplerParameteriv: _emscripten_glSamplerParameteriv,
12547
+ /** @export */
11570
12548
  emscripten_glScissor: _emscripten_glScissor,
11571
12549
  /** @export */
11572
12550
  emscripten_glShaderBinary: _emscripten_glShaderBinary,
@@ -11587,6 +12565,8 @@ function assignWasmImports() {
11587
12565
  /** @export */
11588
12566
  emscripten_glTexImage2D: _emscripten_glTexImage2D,
11589
12567
  /** @export */
12568
+ emscripten_glTexImage3D: _emscripten_glTexImage3D,
12569
+ /** @export */
11590
12570
  emscripten_glTexParameterf: _emscripten_glTexParameterf,
11591
12571
  /** @export */
11592
12572
  emscripten_glTexParameterfv: _emscripten_glTexParameterfv,
@@ -11595,8 +12575,16 @@ function assignWasmImports() {
11595
12575
  /** @export */
11596
12576
  emscripten_glTexParameteriv: _emscripten_glTexParameteriv,
11597
12577
  /** @export */
12578
+ emscripten_glTexStorage2D: _emscripten_glTexStorage2D,
12579
+ /** @export */
12580
+ emscripten_glTexStorage3D: _emscripten_glTexStorage3D,
12581
+ /** @export */
11598
12582
  emscripten_glTexSubImage2D: _emscripten_glTexSubImage2D,
11599
12583
  /** @export */
12584
+ emscripten_glTexSubImage3D: _emscripten_glTexSubImage3D,
12585
+ /** @export */
12586
+ emscripten_glTransformFeedbackVaryings: _emscripten_glTransformFeedbackVaryings,
12587
+ /** @export */
11600
12588
  emscripten_glUniform1f: _emscripten_glUniform1f,
11601
12589
  /** @export */
11602
12590
  emscripten_glUniform1fv: _emscripten_glUniform1fv,
@@ -11605,6 +12593,10 @@ function assignWasmImports() {
11605
12593
  /** @export */
11606
12594
  emscripten_glUniform1iv: _emscripten_glUniform1iv,
11607
12595
  /** @export */
12596
+ emscripten_glUniform1ui: _emscripten_glUniform1ui,
12597
+ /** @export */
12598
+ emscripten_glUniform1uiv: _emscripten_glUniform1uiv,
12599
+ /** @export */
11608
12600
  emscripten_glUniform2f: _emscripten_glUniform2f,
11609
12601
  /** @export */
11610
12602
  emscripten_glUniform2fv: _emscripten_glUniform2fv,
@@ -11613,6 +12605,10 @@ function assignWasmImports() {
11613
12605
  /** @export */
11614
12606
  emscripten_glUniform2iv: _emscripten_glUniform2iv,
11615
12607
  /** @export */
12608
+ emscripten_glUniform2ui: _emscripten_glUniform2ui,
12609
+ /** @export */
12610
+ emscripten_glUniform2uiv: _emscripten_glUniform2uiv,
12611
+ /** @export */
11616
12612
  emscripten_glUniform3f: _emscripten_glUniform3f,
11617
12613
  /** @export */
11618
12614
  emscripten_glUniform3fv: _emscripten_glUniform3fv,
@@ -11621,6 +12617,10 @@ function assignWasmImports() {
11621
12617
  /** @export */
11622
12618
  emscripten_glUniform3iv: _emscripten_glUniform3iv,
11623
12619
  /** @export */
12620
+ emscripten_glUniform3ui: _emscripten_glUniform3ui,
12621
+ /** @export */
12622
+ emscripten_glUniform3uiv: _emscripten_glUniform3uiv,
12623
+ /** @export */
11624
12624
  emscripten_glUniform4f: _emscripten_glUniform4f,
11625
12625
  /** @export */
11626
12626
  emscripten_glUniform4fv: _emscripten_glUniform4fv,
@@ -11629,12 +12629,30 @@ function assignWasmImports() {
11629
12629
  /** @export */
11630
12630
  emscripten_glUniform4iv: _emscripten_glUniform4iv,
11631
12631
  /** @export */
12632
+ emscripten_glUniform4ui: _emscripten_glUniform4ui,
12633
+ /** @export */
12634
+ emscripten_glUniform4uiv: _emscripten_glUniform4uiv,
12635
+ /** @export */
12636
+ emscripten_glUniformBlockBinding: _emscripten_glUniformBlockBinding,
12637
+ /** @export */
11632
12638
  emscripten_glUniformMatrix2fv: _emscripten_glUniformMatrix2fv,
11633
12639
  /** @export */
12640
+ emscripten_glUniformMatrix2x3fv: _emscripten_glUniformMatrix2x3fv,
12641
+ /** @export */
12642
+ emscripten_glUniformMatrix2x4fv: _emscripten_glUniformMatrix2x4fv,
12643
+ /** @export */
11634
12644
  emscripten_glUniformMatrix3fv: _emscripten_glUniformMatrix3fv,
11635
12645
  /** @export */
12646
+ emscripten_glUniformMatrix3x2fv: _emscripten_glUniformMatrix3x2fv,
12647
+ /** @export */
12648
+ emscripten_glUniformMatrix3x4fv: _emscripten_glUniformMatrix3x4fv,
12649
+ /** @export */
11636
12650
  emscripten_glUniformMatrix4fv: _emscripten_glUniformMatrix4fv,
11637
12651
  /** @export */
12652
+ emscripten_glUniformMatrix4x2fv: _emscripten_glUniformMatrix4x2fv,
12653
+ /** @export */
12654
+ emscripten_glUniformMatrix4x3fv: _emscripten_glUniformMatrix4x3fv,
12655
+ /** @export */
11638
12656
  emscripten_glUseProgram: _emscripten_glUseProgram,
11639
12657
  /** @export */
11640
12658
  emscripten_glValidateProgram: _emscripten_glValidateProgram,
@@ -11655,12 +12673,32 @@ function assignWasmImports() {
11655
12673
  /** @export */
11656
12674
  emscripten_glVertexAttrib4fv: _emscripten_glVertexAttrib4fv,
11657
12675
  /** @export */
12676
+ emscripten_glVertexAttribDivisor: _emscripten_glVertexAttribDivisor,
12677
+ /** @export */
11658
12678
  emscripten_glVertexAttribDivisorANGLE: _emscripten_glVertexAttribDivisorANGLE,
11659
12679
  /** @export */
12680
+ emscripten_glVertexAttribDivisorARB: _emscripten_glVertexAttribDivisorARB,
12681
+ /** @export */
12682
+ emscripten_glVertexAttribDivisorEXT: _emscripten_glVertexAttribDivisorEXT,
12683
+ /** @export */
12684
+ emscripten_glVertexAttribDivisorNV: _emscripten_glVertexAttribDivisorNV,
12685
+ /** @export */
12686
+ emscripten_glVertexAttribI4i: _emscripten_glVertexAttribI4i,
12687
+ /** @export */
12688
+ emscripten_glVertexAttribI4iv: _emscripten_glVertexAttribI4iv,
12689
+ /** @export */
12690
+ emscripten_glVertexAttribI4ui: _emscripten_glVertexAttribI4ui,
12691
+ /** @export */
12692
+ emscripten_glVertexAttribI4uiv: _emscripten_glVertexAttribI4uiv,
12693
+ /** @export */
12694
+ emscripten_glVertexAttribIPointer: _emscripten_glVertexAttribIPointer,
12695
+ /** @export */
11660
12696
  emscripten_glVertexAttribPointer: _emscripten_glVertexAttribPointer,
11661
12697
  /** @export */
11662
12698
  emscripten_glViewport: _emscripten_glViewport,
11663
12699
  /** @export */
12700
+ emscripten_glWaitSync: _emscripten_glWaitSync,
12701
+ /** @export */
11664
12702
  emscripten_has_asyncify: _emscripten_has_asyncify,
11665
12703
  /** @export */
11666
12704
  emscripten_pause_main_loop: _emscripten_pause_main_loop,
@@ -11818,21 +12856,21 @@ var _emscripten_stack_set_limits = (a0, a1) => (_emscripten_stack_set_limits = w
11818
12856
  var __emscripten_stack_restore = (a0) => (__emscripten_stack_restore = wasmExports['_emscripten_stack_restore'])(a0);
11819
12857
  var __emscripten_stack_alloc = (a0) => (__emscripten_stack_alloc = wasmExports['_emscripten_stack_alloc'])(a0);
11820
12858
  var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
11821
- var _GBAInputInfo = Module['_GBAInputInfo'] = 120464;
11822
- var _binaryName = Module['_binaryName'] = 196496;
11823
- var _projectName = Module['_projectName'] = 196500;
11824
- var _projectVersion = Module['_projectVersion'] = 196504;
11825
- var _gitCommit = Module['_gitCommit'] = 196480;
11826
- var _gitCommitShort = Module['_gitCommitShort'] = 196484;
11827
- var _gitBranch = Module['_gitBranch'] = 196488;
11828
- var _gitRevision = Module['_gitRevision'] = 196492;
11829
- var _GBIORegisterNames = Module['_GBIORegisterNames'] = 58832;
11830
- var _GBSavestateMagic = Module['_GBSavestateMagic'] = 74096;
11831
- var _GBSavestateVersion = Module['_GBSavestateVersion'] = 74100;
11832
- var _GBA_LUX_LEVELS = Module['_GBA_LUX_LEVELS'] = 103568;
11833
- var _GBAVideoObjSizes = Module['_GBAVideoObjSizes'] = 147904;
11834
- var _GBASavestateMagic = Module['_GBASavestateMagic'] = 147680;
11835
- var _GBASavestateVersion = Module['_GBASavestateVersion'] = 147684;
12859
+ var _GBAInputInfo = Module['_GBAInputInfo'] = 122336;
12860
+ var _binaryName = Module['_binaryName'] = 198368;
12861
+ var _projectName = Module['_projectName'] = 198372;
12862
+ var _projectVersion = Module['_projectVersion'] = 198376;
12863
+ var _gitCommit = Module['_gitCommit'] = 198352;
12864
+ var _gitCommitShort = Module['_gitCommitShort'] = 198356;
12865
+ var _gitBranch = Module['_gitBranch'] = 198360;
12866
+ var _gitRevision = Module['_gitRevision'] = 198364;
12867
+ var _GBIORegisterNames = Module['_GBIORegisterNames'] = 60704;
12868
+ var _GBSavestateMagic = Module['_GBSavestateMagic'] = 75968;
12869
+ var _GBSavestateVersion = Module['_GBSavestateVersion'] = 75972;
12870
+ var _GBA_LUX_LEVELS = Module['_GBA_LUX_LEVELS'] = 105440;
12871
+ var _GBAVideoObjSizes = Module['_GBAVideoObjSizes'] = 149776;
12872
+ var _GBASavestateMagic = Module['_GBASavestateMagic'] = 149552;
12873
+ var _GBASavestateVersion = Module['_GBASavestateVersion'] = 149556;
11836
12874
  function invoke_iiiii(index,a1,a2,a3,a4) {
11837
12875
  var sp = stackSave();
11838
12876
  try {