Skip to content

Commit

Permalink
Fix glUniformMatrix4fv in CAN_ADDRESS_2GB mode (#21264)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Feb 6, 2024
1 parent 58a03c7 commit 97053db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/library_webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];
Expand Down

0 comments on commit 97053db

Please sign in to comment.