Skip to content

Commit e279a10

Browse files
authored
Fix glDrawElements under CAN_ADDRESS_2GB (#21247)
1 parent 3bca209 commit e279a10

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.circleci/config.yml

+3
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

+4-2
Original file line numberDiff line numberDiff line change
@@ -3542,8 +3542,10 @@ var LibraryGLEmulation = {
35423542
GLImmediate.mode = mode;
35433543
if (!GLctx.currentArrayBufferBinding) {
35443544
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
3545-
GLImmediate.lastVertex = end ? end+1 : 0;
3546-
GLImmediate.vertexData = HEAPF32.subarray(GLImmediate.vertexPointer >> 2, end ? (GLImmediate.vertexPointer + (end+1)*GLImmediate.stride) >> 2 : undefined); // XXX assuming float
3545+
GLImmediate.lastVertex = end ? end + 1 : 0;
3546+
start = GLImmediate.vertexPointer;
3547+
end = end ? GLImmediate.vertexPointer + (end+1)*GLImmediate.stride : undefined;
3548+
GLImmediate.vertexData = HEAPF32.subarray({{{ getHeapOffset('start', 'float') }}}, end ? {{{ getHeapOffset('end', 'float') }}} : undefined);
35473549
}
35483550
GLImmediate.flush(count, 0, indices);
35493551
GLImmediate.mode = -1;

0 commit comments

Comments
 (0)