Skip to content

Commit 102fe54

Browse files
authored
Remove OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH. NFC (#23056)
This was the only remaining test-only setting. The same effect can be achieved instead using some EM_ASM.
1 parent 0e87f3d commit 102fe54

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

src/library_webgl.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,6 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
940940
gl.uniform1i(gl.getUniformLocation(blitProgram, "sampler"), 0);
941941
gl.useProgram(null);
942942

943-
context.defaultVao = undefined;
944943
if (gl.createVertexArray) {
945944
context.defaultVao = gl.createVertexArray();
946945
gl.bindVertexArray(context.defaultVao);
@@ -1020,17 +1019,13 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
10201019
gl.drawArrays(5/*GL_TRIANGLE_STRIP*/, 0, 4);
10211020
}
10221021

1023-
#if !OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH
10241022
if (context.defaultVao) {
10251023
// WebGL 2 or OES_vertex_array_object
10261024
var prevVAO = gl.getParameter(0x85B5 /*GL_VERTEX_ARRAY_BINDING*/);
10271025
gl.bindVertexArray(context.defaultVao);
10281026
draw();
10291027
gl.bindVertexArray(prevVAO);
1030-
}
1031-
else
1032-
#endif
1033-
{
1028+
} else {
10341029
var prevVertexAttribPointer = {
10351030
buffer: gl.getVertexAttrib(context.blitPosLoc, 0x889F /*GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING*/),
10361031
size: gl.getVertexAttrib(context.blitPosLoc, 0x8623 /*GL_VERTEX_ATTRIB_ARRAY_SIZE*/),

src/settings.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,14 +2186,6 @@ var LEGACY_RUNTIME = false;
21862186
// [link]
21872187
var SIGNATURE_CONVERSIONS = [];
21882188

2189-
//===========================================
2190-
// Internal, used for testing only, from here
2191-
//===========================================
2192-
2193-
// Internal (testing only): Disables the blitOffscreenFramebuffer VAO path.
2194-
// [link]
2195-
var OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH = false;
2196-
21972189
// For renamed settings the format is:
21982190
// [OLD_NAME, NEW_NAME]
21992191
// For removed settings (which now effectively have a fixed value and can no

test/browser/webgl_offscreen_framebuffer_swap_with_bad_state.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ int main() {
2727

2828
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context("#canvas", &attr);
2929
emscripten_webgl_make_context_current(ctx);
30+
#ifdef TEST_DISABLE_VAO
31+
EM_ASM({
32+
console.log(GL.currentContext.defaultVao);
33+
assert(GL.currentContext.defaultVao);
34+
GL.currentContext.defaultVao = undefined;
35+
});
36+
#endif
3037

3138
#if !TEST_WEBGL2 && TEST_VERIFY_WEBGL1_VAO_SUPPORT
3239
// This test cannot run without browser support for OES_vertex_array_object.

test/test_browser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4321,14 +4321,14 @@ def test_webgl_vao_without_automatic_extensions(self):
43214321
@requires_graphics_hardware
43224322
@parameterized({
43234323
# full state restoration path on WebGL 1.0
4324-
'gl1_no_vao': (['-sMAX_WEBGL_VERSION=1', '-sOFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH'],),
4324+
'gl1_no_vao': (['-sMAX_WEBGL_VERSION=1', '-DTEST_DISABLE_VAO'],),
43254325
# VAO path on WebGL 1.0
43264326
'gl1': (['-sMAX_WEBGL_VERSION=1', '-DTEST_VERIFY_WEBGL1_VAO_SUPPORT=1'],),
43274327
'gl1_max_gl2': (['-sMAX_WEBGL_VERSION=2'],),
43284328
# VAO path on WebGL 2.0
43294329
'gl2': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1'],),
43304330
# full state restoration path on WebGL 2.0
4331-
'gl2_no_vao': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1', '-sOFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH'],),
4331+
'gl2_no_vao': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1', '-DTEST_DISABLE_VAO'],),
43324332
# blitFramebuffer path on WebGL 2.0 (falls back to VAO on Firefox < 67)
43334333
'gl2_no_aa': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=0'],),
43344334
})

tools/maint/update_settings_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def write_file(f):
8080
current_comment = []
8181
current_tags = []
8282
for line in read_file(path_from_root('src/settings.js')).splitlines():
83-
if 'Internal, used for testing only, from here' in line:
83+
if 'LEGACY_SETTINGS' in line:
8484
break
8585
if not line:
8686
current_comment = []

0 commit comments

Comments
 (0)