WebGL1 context reports the WebGL2 extension list: getSupportedExtensions()/getExtension() contradiction
Environment: ShardX Launcher 2.0.2 (Windows 11, NSIS per-user install), engine Chromium 152.0.7977.65 build 3, profile created from a bundled win-* preset (e.g. win-gtx1650, webgl.extensions with 35 entries), host GPU NVIDIA RTX 5090.
What happens
On a WebGL1 context, gl.getSupportedExtensions() returns the same list the WebGL2 context returns (32 names after the engine narrows the preset's 35 to what the host backs). 13 of those names are WebGL2-only, so gl.getExtension(name) returns null for every one of them on the WebGL1 context:
EXT_color_buffer_float, EXT_conservative_depth, EXT_disjoint_timer_query_webgl2, EXT_render_snorm,
EXT_texture_norm16, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_sample_variables,
OES_shader_multisample_interpolation, OVR_multiview2, WEBGL_clip_cull_distance, WEBGL_provoking_vertex,
WEBGL_stencil_texturing
Conversely, the WebGL1-only extensions a real Chrome on the same hardware lists are absent from the WebGL1 list: ANGLE_instanced_arrays, OES_vertex_array_object, EXT_frag_depth, OES_texture_float, OES_texture_half_float, OES_texture_half_float_linear, WEBGL_depth_texture, WEBGL_draw_buffers, OES_standard_derivatives, OES_element_index_uint, EXT_shader_texture_lod, EXT_sRGB, WEBGL_color_buffer_float, EXT_blend_minmax, OES_fbo_render_mipmap, EXT_disjoint_timer_query.
Why it matters
This is exactly the list-says-yes / object-says-no pair that src-tauri/src/gpu_caps.rs describes as the cheapest way to catch a rewritten extension list: two calls, no permission, no timing, no baseline. Fingerprinting libraries already compare getSupportedExtensions() against getExtension() per context.
Repro (inside any profile)
const g = document.createElement('canvas').getContext('webgl');
const g2 = document.createElement('canvas').getContext('webgl2');
console.log(JSON.stringify(g.getSupportedExtensions()) === JSON.stringify(g2.getSupportedExtensions())); // true
console.log(g.getSupportedExtensions().filter((e) => !g.getExtension(e))); // 13 names
Suggestion
Presets carry a single webgl.extensions list. Either add a per-context list (webgl.extensions_webgl1) captured from a WebGL1 context, or derive the WebGL1 list from the WebGL2 one with the known WebGL1/WebGL2 mapping and, in the meantime, avoid applying the WebGL2 list to WebGL1 contexts (let the host list through, narrowed, rather than a self-contradicting one).
in v2.0.3
Confirmed fixed on 2.0.3 / engine build 4 for profiles carrying both lists: WebGL1 lists 35 (all resolvable), WebGL2 lists 32. One edge case from our side: a profile created on 2.0.2 from a preset whose single extensions list was already the 32-name WebGL2 list, and which the launcher's migration then copied into extensions_v2, carries two identical lists — and "declares both, used exactly as written" hands the WebGL2 list to WebGL1 again (13 unresolvable). Treating identical extensions/extensions_v2 as a single list to split would cover it; we fixed our profiles by re-syncing extensions from the library preset.