diff --git a/.circleci/config.yml b/.circleci/config.yml index 2df4ac47f0fc..bb9b010c0f2b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -819,6 +819,8 @@ jobs: browser_2gb.test_cubegeom* browser_2gb.test_html5_webgl_create_context* browser_2gb.test_main_thread_async_em_asm + browser_2gb.test_webgl2_* + browser_2gb.test_webgl_* " test-browser-chrome-wasm64-4gb: executor: bionic diff --git a/src/library_webgl.js b/src/library_webgl.js index 4fa7c4bd6268..2aa5d23f8d22 100644 --- a/src/library_webgl.js +++ b/src/library_webgl.js @@ -2459,12 +2459,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, value>>2, count); + count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count); #else #if MAX_WEBGL_VERSION >= 2 if ({{{ isCurrentContextWebGL2() }}}) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible. - count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, value>>2, count); + count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count); return; } #endif @@ -2500,12 +2500,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, value>>2, count*2); + count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count*2); #else #if MAX_WEBGL_VERSION >= 2 if ({{{ isCurrentContextWebGL2() }}}) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible. - count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, value>>2, count*2); + count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count*2); return; } #endif @@ -2542,12 +2542,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, value>>2, count*3); + count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count*3); #else #if MAX_WEBGL_VERSION >= 2 if ({{{ isCurrentContextWebGL2() }}}) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible. - count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, value>>2, count*3); + count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count*3); return; } #endif @@ -2585,14 +2585,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform4iv(webglGetUniformLocation(location), HEAP32, value>>2, count*4); + count && GLctx.uniform4iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count*4); #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.uniform4iv(webglGetUniformLocation(location), HEAP32, value>>2, count*4); + count && GLctx.uniform4iv(webglGetUniformLocation(location), HEAP32, {{{ getHeapOffset('value', 'i32') }}}, count*4); return; } #endif @@ -2631,12 +2631,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, value>>2, count); + count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count); #else #if MAX_WEBGL_VERSION >= 2 if ({{{ isCurrentContextWebGL2() }}}) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible. - count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, value>>2, count); + count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count); return; } #endif @@ -2672,14 +2672,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform2fv(webglGetUniformLocation(location), HEAPF32, value>>2, count*2); + count && GLctx.uniform2fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*2); #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.uniform2fv(webglGetUniformLocation(location), HEAPF32, value>>2, count*2); + count && GLctx.uniform2fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*2); return; } #endif @@ -2709,21 +2709,21 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; glUniform3fv: (location, count, value) => { #if GL_ASSERTIONS GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniform3fv', 'location'); - assert((value & 3) == 0, 'Pointer to float data passed to glUniform3fv must be aligned to four bytes!' + value); + assert((value % 4) == 0, 'Pointer to float data passed to glUniform3fv must be aligned to four bytes!' + value); #endif #if MIN_WEBGL_VERSION >= 2 #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform3fv(webglGetUniformLocation(location), HEAPF32, value>>2, count*3); + count && GLctx.uniform3fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*3); #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.uniform3fv(webglGetUniformLocation(location), HEAPF32, value>>2, count*3); + count && GLctx.uniform3fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*3); return; } #endif @@ -2761,14 +2761,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniform4fv(webglGetUniformLocation(location), HEAPF32, value>>2, count*4); + count && GLctx.uniform4fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*4); #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.uniform4fv(webglGetUniformLocation(location), HEAPF32, value>>2, count*4); + count && GLctx.uniform4fv(webglGetUniformLocation(location), HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*4); return; } #endif @@ -2811,14 +2811,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*4); + count && GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*4); #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.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*4); + count && GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*4); return; } #endif @@ -2857,14 +2857,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #if GL_ASSERTIONS assert(GL.currentContext.version >= 2); #endif - count && GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*9); + count && GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*9); #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.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*9); + count && GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*9); return; } #endif @@ -3966,9 +3966,9 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; GLctx.multiDrawWebgl['multiDrawArraysWEBGL']( mode, HEAP32, - firsts >> 2, + {{{ getHeapOffset('firsts', 'i32') }}}, HEAP32, - counts >> 2, + {{{ getHeapOffset('counts', 'i32') }}}, drawcount); }, @@ -3978,11 +3978,11 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; GLctx.multiDrawWebgl['multiDrawArraysInstancedWEBGL']( mode, HEAP32, - firsts >> 2, + {{{ getHeapOffset('firsts', 'i32') }}}, HEAP32, - counts >> 2, + {{{ getHeapOffset('counts', 'i32') }}}, HEAP32, - instanceCounts >> 2, + {{{ getHeapOffset('instanceCounts', 'i32') }}}, drawcount); }, @@ -4017,10 +4017,10 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; GLctx.multiDrawWebgl['multiDrawElementsWEBGL']( mode, HEAP32, - counts >> 2, + {{{ getHeapOffset('counts', 'float') }}}, type, HEAP32, - offsets >> 2, + {{{ getHeapOffset('offsets', 'float') }}}, drawcount); #if MEMORY64 stackRestore(stack); @@ -4040,12 +4040,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; GLctx.multiDrawWebgl['multiDrawElementsInstancedWEBGL']( mode, HEAP32, - counts >> 2, + {{{ getHeapOffset('counts', 'i32') }}}, type, HEAP32, - offsets >> 2, + {{{ getHeapOffset('offsets', 'i32') }}}, HEAP32, - instanceCounts >> 2, + {{{ getHeapOffset('instanceCounts', 'i32') }}}, drawcount); #if MEMORY64 stackRestore(stack); diff --git a/src/library_webgl2.js b/src/library_webgl2.js index 269b18717a22..3285e7ce6291 100644 --- a/src/library_webgl2.js +++ b/src/library_webgl2.js @@ -622,7 +622,7 @@ var LibraryWebGL2 = { assert((value & 3) == 0, 'Pointer to integer data passed to glClearBufferiv must be aligned to four bytes!'); #endif - GLctx.clearBufferiv(buffer, drawbuffer, HEAP32, value>>2); + GLctx.clearBufferiv(buffer, drawbuffer, HEAP32, {{{ getHeapOffset('value', 'i32') }}}); }, glClearBufferuiv: (buffer, drawbuffer, value) => { @@ -630,7 +630,7 @@ var LibraryWebGL2 = { assert((value & 3) == 0, 'Pointer to integer data passed to glClearBufferuiv must be aligned to four bytes!'); #endif - GLctx.clearBufferuiv(buffer, drawbuffer, HEAPU32, value>>2); + GLctx.clearBufferuiv(buffer, drawbuffer, HEAPU32, {{{ getHeapOffset('value', 'u32') }}}); }, glClearBufferfv: (buffer, drawbuffer, value) => { @@ -638,7 +638,7 @@ var LibraryWebGL2 = { assert((value & 3) == 0, 'Pointer to float data passed to glClearBufferfv must be aligned to four bytes!'); #endif - GLctx.clearBufferfv(buffer, drawbuffer, HEAPF32, value>>2); + GLctx.clearBufferfv(buffer, drawbuffer, HEAPF32, {{{ getHeapOffset('value', 'float') }}}); }, glFenceSync: (condition, flags) => { @@ -776,7 +776,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniform1uiv', 'location'); assert((value & 3) == 0, 'Pointer to integer data passed to glUniform1uiv must be aligned to four bytes!'); #endif - count && GLctx.uniform1uiv(webglGetUniformLocation(location), HEAPU32, value>>2, count); + count && GLctx.uniform1uiv(webglGetUniformLocation(location), HEAPU32, {{{ getHeapOffset('value', 'u32') }}}, count); }, glUniform2uiv__deps: ['$webglGetUniformLocation'], @@ -785,7 +785,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniform2uiv', 'location'); assert((value & 3) == 0, 'Pointer to integer data passed to glUniform2uiv must be aligned to four bytes!'); #endif - count && GLctx.uniform2uiv(webglGetUniformLocation(location), HEAPU32, value>>2, count*2); + count && GLctx.uniform2uiv(webglGetUniformLocation(location), HEAPU32, {{{ getHeapOffset('value', 'u32') }}}, count*2); }, glUniform3uiv__deps: ['$webglGetUniformLocation'], @@ -794,7 +794,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniform3uiv', 'location'); assert((value & 3) == 0, 'Pointer to integer data passed to glUniform3uiv must be aligned to four bytes!'); #endif - count && GLctx.uniform3uiv(webglGetUniformLocation(location), HEAPU32, value>>2, count*3); + count && GLctx.uniform3uiv(webglGetUniformLocation(location), HEAPU32, {{{ getHeapOffset('value', 'u32') }}}, count*3); }, glUniform4uiv__deps: ['$webglGetUniformLocation'], @@ -803,7 +803,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniform4uiv', 'location'); assert((value & 3) == 0, 'Pointer to integer data passed to glUniform4uiv must be aligned to four bytes!'); #endif - count && GLctx.uniform4uiv(webglGetUniformLocation(location), HEAPU32, value>>2, count*4); + count && GLctx.uniform4uiv(webglGetUniformLocation(location), HEAPU32, {{{ getHeapOffset('value', 'u32') }}}, count*4); }, glUniformMatrix2x3fv__deps: ['$webglGetUniformLocation'], @@ -812,7 +812,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniformMatrix2x3fv', 'location'); assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix2x3fv must be aligned to four bytes!'); #endif - count && GLctx.uniformMatrix2x3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*6); + count && GLctx.uniformMatrix2x3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*6); }, glUniformMatrix3x2fv__deps: ['$webglGetUniformLocation'], @@ -821,7 +821,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniformMatrix3x2fv', 'location'); assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix3x2fv must be aligned to four bytes!'); #endif - count && GLctx.uniformMatrix3x2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*6); + count && GLctx.uniformMatrix3x2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*6); }, glUniformMatrix2x4fv__deps: ['$webglGetUniformLocation'], @@ -830,7 +830,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniformMatrix2x4fv', 'location'); assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix2x4fv must be aligned to four bytes!'); #endif - count && GLctx.uniformMatrix2x4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*8); + count && GLctx.uniformMatrix2x4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*8); }, glUniformMatrix4x2fv__deps: ['$webglGetUniformLocation'], @@ -839,7 +839,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniformMatrix4x2fv', 'location'); assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix4x2fv must be aligned to four bytes!'); #endif - count && GLctx.uniformMatrix4x2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*8); + count && GLctx.uniformMatrix4x2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*8); }, glUniformMatrix3x4fv__deps: ['$webglGetUniformLocation'], @@ -848,7 +848,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniformMatrix3x4fv', 'location'); assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix3x4fv must be aligned to four bytes!'); #endif - count && GLctx.uniformMatrix3x4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*12); + count && GLctx.uniformMatrix3x4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*12); }, glUniformMatrix4x3fv__deps: ['$webglGetUniformLocation'], @@ -857,7 +857,7 @@ var LibraryWebGL2 = { GL.validateGLObjectID(GLctx.currentProgram.uniformLocsById, location, 'glUniformMatrix4x3fv', 'location'); assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix4x3fv must be aligned to four bytes!'); #endif - count && GLctx.uniformMatrix4x3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value>>2, count*12); + count && GLctx.uniformMatrix4x3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, {{{ getHeapOffset('value', 'float') }}}, count*12); }, glVertexAttribI4iv: (index, v) => { @@ -968,13 +968,13 @@ var LibraryWebGL2 = { GLctx.mdibvbi['multiDrawArraysInstancedBaseInstanceWEBGL']( mode, HEAP32, - firsts >> 2, + {{{ getHeapOffset('firsts', 'i32') }}}, HEAP32, - counts >> 2, + {{{ getHeapOffset('counts', 'i32') }}}, HEAP32, - instanceCounts >> 2, + {{{ getHeapOffset('instanceCounts', 'i32') }}}, HEAPU32, - baseInstances >> 2, + {{{ getHeapOffset('baseInstances', 'i32') }}}, drawCount); }, glMultiDrawArraysInstancedBaseInstanceANGLE: 'glMultiDrawArraysInstancedBaseInstanceWEBGL', @@ -984,16 +984,16 @@ var LibraryWebGL2 = { GLctx.mdibvbi['multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL']( mode, HEAP32, - counts >> 2, + {{{ getHeapOffset('counts', 'i32') }}}, type, HEAP32, - offsets >> 2, + {{{ getHeapOffset('offsets', 'i32') }}}, HEAP32, - instanceCounts >> 2, + {{{ getHeapOffset('instanceCounts', 'i32') }}}, HEAP32, - baseVertices >> 2, + {{{ getHeapOffset('baseVertices', 'i32') }}}, HEAPU32, - baseInstances >> 2, + {{{ getHeapOffset('baseInstances', 'i32') }}}, drawCount); }, glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE: 'glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL', diff --git a/test/browser/webgl2_garbage_free_entrypoints.cpp b/test/browser/webgl2_garbage_free_entrypoints.cpp index 876b5fbd7a58..17ce65e8cfc5 100644 --- a/test/browser/webgl2_garbage_free_entrypoints.cpp +++ b/test/browser/webgl2_garbage_free_entrypoints.cpp @@ -56,11 +56,14 @@ int main(int argc, char *argv[]) assert(glGetError() == GL_NO_ERROR && "Shader program link failed"); int color_loc = glGetUniformLocation(program, "color"); + assert(glGetError() == GL_NO_ERROR); assert(color_loc != -1); glUseProgram(program); + assert(glGetError() == GL_NO_ERROR); float col[3] = { 0.2f, 0.2f, 0.2f }; glUniform3fv(color_loc, 1, col); + assert(glGetError() == GL_NO_ERROR); int loc2 = glGetUniformLocation(program, "colors[2]"); int loc = glGetUniformLocation(program, "colors"); @@ -75,7 +78,10 @@ int main(int argc, char *argv[]) float colors[4*3] = { 1,0,0, 0,0.5,0, 0,0,0.2, 1,1,1 }; - glUniform3fv(loc+1, 3, colors+3); // Pass the actual colors (testing a nonzero location offset), but do a mistake by setting one index too many. Spec says this should be gracefully handled, and that excess elements are ignored. + // Pass the actual colors (testing a nonzero location offset), but do a + // mistake by setting one index too many. Spec says this should be gracefully + // handled, and that excess elements are ignored. + glUniform3fv(loc+1, 3, colors+3); assert(glGetError() == GL_NO_ERROR); glUniform3fv(loc, 1, colors); // Set the first index as well. assert(glGetError() == GL_NO_ERROR); diff --git a/test/test_browser.py b/test/test_browser.py index 8fb6550edd29..8c8101b0acf7 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -2802,9 +2802,12 @@ def test_webgl2_ubos(self): self.btest_exit('webgl2_ubos.cpp', args=['-sMAX_WEBGL_VERSION=2', '-lGL']) @requires_graphics_hardware - def test_webgl2_garbage_free_entrypoints(self): - self.btest_exit('webgl2_garbage_free_entrypoints.cpp', args=['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1']) - self.btest_exit('webgl2_garbage_free_entrypoints.cpp') + @parameterized({ + '': ([],), + 'webgl2': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1'],), + }) + def test_webgl2_garbage_free_entrypoints(self, args): + self.btest_exit('webgl2_garbage_free_entrypoints.cpp', args=args) @requires_graphics_hardware def test_webgl2_backwards_compatibility_emulation(self): @@ -4622,6 +4625,8 @@ def test_webgl_from_client_side_memory_without_default_enabled_extensions(self): # For testing WebGL draft extensions like this, if using chrome as the browser, # We might want to append the --enable-webgl-draft-extensions to the EMTEST_BROWSER env arg. @requires_graphics_hardware + @no_2gb('multiDrawElementsInstancedWEBGL: size exceeds the supported range') + @no_4gb('multiDrawElementsInstancedWEBGL: size exceeds the supported range') @parameterized({ 'arrays': (['-DMULTI_DRAW_ARRAYS'],), 'arrays_instanced': (['-DMULTI_DRAW_ARRAYS_INSTANCED'],),