diff --git a/src/library_webgl.js b/src/library_webgl.js index 5171541e4e116..d7d1e856c232e 100644 --- a/src/library_webgl.js +++ b/src/library_webgl.js @@ -940,7 +940,6 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; gl.uniform1i(gl.getUniformLocation(blitProgram, "sampler"), 0); gl.useProgram(null); - context.defaultVao = undefined; if (gl.createVertexArray) { context.defaultVao = gl.createVertexArray(); gl.bindVertexArray(context.defaultVao); @@ -1020,17 +1019,13 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; gl.drawArrays(5/*GL_TRIANGLE_STRIP*/, 0, 4); } -#if !OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH if (context.defaultVao) { // WebGL 2 or OES_vertex_array_object var prevVAO = gl.getParameter(0x85B5 /*GL_VERTEX_ARRAY_BINDING*/); gl.bindVertexArray(context.defaultVao); draw(); gl.bindVertexArray(prevVAO); - } - else -#endif - { + } else { var prevVertexAttribPointer = { buffer: gl.getVertexAttrib(context.blitPosLoc, 0x889F /*GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING*/), size: gl.getVertexAttrib(context.blitPosLoc, 0x8623 /*GL_VERTEX_ATTRIB_ARRAY_SIZE*/), diff --git a/src/settings.js b/src/settings.js index 6df46f5572693..6610dc1e781d2 100644 --- a/src/settings.js +++ b/src/settings.js @@ -2186,14 +2186,6 @@ var LEGACY_RUNTIME = false; // [link] var SIGNATURE_CONVERSIONS = []; -//=========================================== -// Internal, used for testing only, from here -//=========================================== - -// Internal (testing only): Disables the blitOffscreenFramebuffer VAO path. -// [link] -var OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH = false; - // For renamed settings the format is: // [OLD_NAME, NEW_NAME] // For removed settings (which now effectively have a fixed value and can no diff --git a/test/browser/webgl_offscreen_framebuffer_swap_with_bad_state.c b/test/browser/webgl_offscreen_framebuffer_swap_with_bad_state.c index 759fb353485e0..7d8853f0b5972 100644 --- a/test/browser/webgl_offscreen_framebuffer_swap_with_bad_state.c +++ b/test/browser/webgl_offscreen_framebuffer_swap_with_bad_state.c @@ -27,6 +27,13 @@ int main() { EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context("#canvas", &attr); emscripten_webgl_make_context_current(ctx); +#ifdef TEST_DISABLE_VAO + EM_ASM({ + console.log(GL.currentContext.defaultVao); + assert(GL.currentContext.defaultVao); + GL.currentContext.defaultVao = undefined; + }); +#endif #if !TEST_WEBGL2 && TEST_VERIFY_WEBGL1_VAO_SUPPORT // This test cannot run without browser support for OES_vertex_array_object. diff --git a/test/test_browser.py b/test/test_browser.py index b5a6b97d93611..93434703dc086 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -4321,14 +4321,14 @@ def test_webgl_vao_without_automatic_extensions(self): @requires_graphics_hardware @parameterized({ # full state restoration path on WebGL 1.0 - 'gl1_no_vao': (['-sMAX_WEBGL_VERSION=1', '-sOFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH'],), + 'gl1_no_vao': (['-sMAX_WEBGL_VERSION=1', '-DTEST_DISABLE_VAO'],), # VAO path on WebGL 1.0 'gl1': (['-sMAX_WEBGL_VERSION=1', '-DTEST_VERIFY_WEBGL1_VAO_SUPPORT=1'],), 'gl1_max_gl2': (['-sMAX_WEBGL_VERSION=2'],), # VAO path on WebGL 2.0 'gl2': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1'],), # full state restoration path on WebGL 2.0 - 'gl2_no_vao': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1', '-sOFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH'],), + 'gl2_no_vao': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1', '-DTEST_DISABLE_VAO'],), # blitFramebuffer path on WebGL 2.0 (falls back to VAO on Firefox < 67) 'gl2_no_aa': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=0'],), }) diff --git a/tools/maint/update_settings_docs.py b/tools/maint/update_settings_docs.py index bb39d5a2f1cca..b8bb781a30d69 100755 --- a/tools/maint/update_settings_docs.py +++ b/tools/maint/update_settings_docs.py @@ -80,7 +80,7 @@ def write_file(f): current_comment = [] current_tags = [] for line in read_file(path_from_root('src/settings.js')).splitlines(): - if 'Internal, used for testing only, from here' in line: + if 'LEGACY_SETTINGS' in line: break if not line: current_comment = []