Skip to content

Commit 97053db

Browse files
authored
Fix glUniformMatrix4fv in CAN_ADDRESS_2GB mode (#21264)
1 parent 58a03c7 commit 97053db

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,7 @@ jobs:
818818
browser_2gb.test_fetch_to_memory
819819
browser_2gb.test_emscripten_animate_canvas_element_size_manual_css
820820
browser_2gb.test_fulles2_sdlproc
821-
browser_2gb.test_cubegeom
822-
browser_2gb.test_cubegeom_normal
823-
browser_2gb.test_cubegeom_normal_dap
824-
browser_2gb.test_cubegeom_normal_dap_far
821+
browser_2gb.test_cubegeom*
825822
"
826823
test-browser-chrome-wasm64-4gb:
827824
executor: bionic

src/library_webgl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,14 +2911,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
29112911
#if GL_ASSERTIONS
29122912
assert(GL.currentContext.version >= 2);
29132913
#endif
2914-
count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*16);
2914+
count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*16);
29152915
#else
29162916

29172917
#if MAX_WEBGL_VERSION >= 2
29182918
// WebGL 2 provides new garbage-free entry points to call to WebGL. Use
29192919
// those always when possible.
29202920
if ({{{ isCurrentContextWebGL2() }}}) {
2921-
count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*16);
2921+
count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*16);
29222922
return;
29232923
}
29242924
#endif
@@ -2929,7 +2929,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
29292929
var view = miniTempWebGLFloatBuffers[16*count-1];
29302930
// hoist the heap out of the loop for size and for pthreads+growth.
29312931
var heap = HEAPF32;
2932-
value >>= 2;
2932+
value = {{{ getHeapOffset('value', 'float') }}};
29332933
for (var i = 0; i < 16 * count; i += 16) {
29342934
var dst = value + i;
29352935
view[i] = heap[dst];

0 commit comments

Comments
 (0)