diff options
author | mattkae <mattkae@protonmail.com> | 2022-05-07 12:17:36 -0400 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2022-05-07 12:17:36 -0400 |
commit | 0b8596a5ebec39f797fe8a14eed1bda3c2e3a93d (patch) | |
tree | ea248ce7d55046d578f5ad371f4083405a4f7892 /themes/dist | |
parent | 1c051dffdb27ff6ebaa96802b021e99e49afb861 (diff) |
Working bunny render
Diffstat (limited to 'themes/dist')
-rw-r--r-- | themes/dist/output.js | 30 | ||||
-rwxr-xr-x | themes/dist/output.wasm | bin | 89301 -> 116476 bytes |
2 files changed, 28 insertions, 2 deletions
diff --git a/themes/dist/output.js b/themes/dist/output.js index a11cf80..0e9f1a9 100644 --- a/themes/dist/output.js +++ b/themes/dist/output.js @@ -3226,6 +3226,31 @@ var ASM_CONSTS = { GL.postDrawHandleClientVertexAttribBindings(); } + function _glDrawElements(mode, count, type, indices) { + var buf; + if (!GLctx.currentElementArrayBufferBinding) { + var size = GL.calcBufLength(1, type, 0, count); + buf = GL.getTempIndexBuffer(size); + GLctx.bindBuffer(0x8893 /*GL_ELEMENT_ARRAY_BUFFER*/, buf); + GLctx.bufferSubData(0x8893 /*GL_ELEMENT_ARRAY_BUFFER*/, + 0, + HEAPU8.subarray(indices, indices + size)); + // the index is now 0 + indices = 0; + } + + // bind any client-side buffers + GL.preDrawHandleClientVertexAttribBindings(count); + + GLctx.drawElements(mode, count, type, indices); + + GL.postDrawHandleClientVertexAttribBindings(count); + + if (!GLctx.currentElementArrayBufferBinding) { + GLctx.bindBuffer(0x8893 /*GL_ELEMENT_ARRAY_BUFFER*/, null); + } + } + function _glEnable(x0) { GLctx['enable'](x0) } function _glEnableVertexAttribArray(index) { @@ -3629,6 +3654,7 @@ var asmLibraryArg = { "glDepthFunc": _glDepthFunc, "glDepthMask": _glDepthMask, "glDrawArrays": _glDrawArrays, + "glDrawElements": _glDrawElements, "glEnable": _glEnable, "glEnableVertexAttribArray": _glEnableVertexAttribArray, "glGenBuffers": _glGenBuffers, @@ -3656,10 +3682,10 @@ var ___wasm_call_ctors = Module["___wasm_call_ctors"] = createExportWrapper("__w var _main = Module["_main"] = createExportWrapper("main"); /** @type {function(...*):?} */ -var _free = Module["_free"] = createExportWrapper("free"); +var _malloc = Module["_malloc"] = createExportWrapper("malloc"); /** @type {function(...*):?} */ -var _malloc = Module["_malloc"] = createExportWrapper("malloc"); +var _free = Module["_free"] = createExportWrapper("free"); /** @type {function(...*):?} */ var ___errno_location = Module["___errno_location"] = createExportWrapper("__errno_location"); diff --git a/themes/dist/output.wasm b/themes/dist/output.wasm Binary files differindex b8a0e67..4c50e4a 100755 --- a/themes/dist/output.wasm +++ b/themes/dist/output.wasm |