Skip to content

Commit

Permalink
Fix glDrawElements under CAN_ADDRESS_2GB
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Feb 2, 2024
1 parent 7514cc2 commit b4c5a4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ 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
"
test-browser-chrome-wasm64-4gb:
executor: bionic
Expand Down
6 changes: 4 additions & 2 deletions src/library_glemu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3527,8 +3527,10 @@ var LibraryGLEmulation = {
GLImmediate.mode = mode;
if (!GLctx.currentArrayBufferBinding) {
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
GLImmediate.lastVertex = end ? end+1 : 0;
GLImmediate.vertexData = HEAPF32.subarray(GLImmediate.vertexPointer >> 2, end ? (GLImmediate.vertexPointer + (end+1)*GLImmediate.stride) >> 2 : undefined); // XXX assuming float
GLImmediate.lastVertex = end ? end + 1 : 0;
start = GLImmediate.vertexPointer;
end = end ? GLImmediate.vertexPointer + (end+1)*GLImmediate.stride : undefined;
GLImmediate.vertexData = HEAPF32.subarray({{{ getHeapOffset('start', 'float') }}}, end ? {{{ getHeapOffset('end', 'float') }}} : undefined);
}
GLImmediate.flush(count, 0, indices);
GLImmediate.mode = -1;
Expand Down

0 comments on commit b4c5a4b

Please sign in to comment.