Skip to content

Commit b4c5a4b

Browse files
committed
Fix glDrawElements under CAN_ADDRESS_2GB
1 parent 7514cc2 commit b4c5a4b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,9 @@ 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
821824
"
822825
test-browser-chrome-wasm64-4gb:
823826
executor: bionic

src/library_glemu.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3527,8 +3527,10 @@ var LibraryGLEmulation = {
35273527
GLImmediate.mode = mode;
35283528
if (!GLctx.currentArrayBufferBinding) {
35293529
GLImmediate.firstVertex = end ? start : HEAP8.length; // if we don't know the start, set an invalid value and we will calculate it later from the indices
3530-
GLImmediate.lastVertex = end ? end+1 : 0;
3531-
GLImmediate.vertexData = HEAPF32.subarray(GLImmediate.vertexPointer >> 2, end ? (GLImmediate.vertexPointer + (end+1)*GLImmediate.stride) >> 2 : undefined); // XXX assuming float
3530+
GLImmediate.lastVertex = end ? end + 1 : 0;
3531+
start = GLImmediate.vertexPointer;
3532+
end = end ? GLImmediate.vertexPointer + (end+1)*GLImmediate.stride : undefined;
3533+
GLImmediate.vertexData = HEAPF32.subarray({{{ getHeapOffset('start', 'float') }}}, end ? {{{ getHeapOffset('end', 'float') }}} : undefined);
35323534
}
35333535
GLImmediate.flush(count, 0, indices);
35343536
GLImmediate.mode = -1;

0 commit comments

Comments
 (0)