From 97053db62d6dd043a36043742319b3340399d8fc Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 6 Feb 2024 01:02:04 +0000 Subject: [PATCH] Fix glUniformMatrix4fv in CAN_ADDRESS_2GB mode (#21264) --- .circleci/config.yml | 5 +---- src/library_webgl.js | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 586e0f56386b1..109750f75af8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -818,10 +818,7 @@ jobs: browser_2gb.test_fetch_to_memory browser_2gb.test_emscripten_animate_canvas_element_size_manual_css browser_2gb.test_fulles2_sdlproc - browser_2gb.test_cubegeom - browser_2gb.test_cubegeom_normal - browser_2gb.test_cubegeom_normal_dap - browser_2gb.test_cubegeom_normal_dap_far + browser_2gb.test_cubegeom* " test-browser-chrome-wasm64-4gb: executor: bionic diff --git a/src/library_webgl.js b/src/library_webgl.js index f7989608c2eca..f052e2c95098f 100644 --- a/src/library_webgl.js +++ b/src/library_webgl.js @@ -2911,14 +2911,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*16); + count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*16); #else #if MAX_WEBGL_VERSION >= 2 // WebGL 2 provides new garbage-free entry points to call to WebGL. Use // those always when possible. if ({{{ isCurrentContextWebGL2() }}}) { - count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*16); + count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*16); return; } #endif @@ -2929,7 +2929,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; var view = miniTempWebGLFloatBuffers[16*count-1]; // hoist the heap out of the loop for size and for pthreads+growth. var heap = HEAPF32; - value >>= 2; + value = {{{ getHeapOffset('value', 'float') }}}; for (var i = 0; i < 16 * count; i += 16) { var dst = value + i; view[i] = heap[dst];