Require GLSL version >= 150 for WebGL
Categories
(Core :: Graphics, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: jnicol, Assigned: jnicol)
References
Details
Attachments
(2 files)
Upstream ANGLE has removed shader translator output support for GLSL versions < 150. (GLSL version 150 corresponds to GL version 3.2).
When we next update ANGLE in bug 1908744, this means we can no longer support WebGL on contexts using older GLSL versions. In practice this is probably a small, but not non-existent, proportion of our users. At least in some cases we should still be able to support WebGL 1 for some of these users by preferring to give them an ES 2 context over a pre-3.2 desktop context.
I think we might as well make this change now in advance of the impending ANGLE update, and see what fallout there is, if any.
My intended plan for this is:
- Remove the pref webgl.1.allow-core-profiles. Currently true on macos and false elsewhere.
- Instead, act as if the pref was true, i.e. do not set
REQUIRE_COMPAT_PROFILEhere - Retain the gfxVar that can still set
REQUIRE_COMPAT_PROFILEjust below. In practice this is only used for Intel HD Graphics 3000 on OSX (bug 1413269), which as far as I can tell cannot run a recent enough OS to run firefox. But it seems safer to keep this just in case. - The absence of
REQUIRE_COMPAT_PROFILEwill ensure our GLContextProvider impls request a 3.2 core context - If this fails, GLContextProviderEGL at least will fallback to attempting to create a GLES 2 context.
- If this fails, we're out of luck.
WebGLContext::InitAndValidateGL() should then check the GLSL version for desktop GL contexts and validate it's high enough.
One consequence of this is that when running WebGL 1 on drivers that do in fact support GL 3.2 onwards, we will now request and receive a core context rather than a compatibility context. e.g. on my linux computer I currently get 4.6 (Compatibility Profile) Mesa 25.3.6, and would instead get 4.6 (Core Profile) Mesa 25.3.6. In theory I don't think this should make any difference, but in practice I guess could uncover driver bugs. Let's see.
| Assignee | ||
Comment 1•1 month ago
|
||
Upstream ANGLE has dropped support for shader translator output
targetting GLSL versions lower than 150. In preparation for the
upcoming ANGLE update, this patch blocks WebGL when the supported GLSL
version is too low. Additionally it removes references to the
soon-to-be-removed ShShaderOutput values when creating the shader
validator, which is required to compile when we next update ANGLE.
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
In anticipation of the next ANGLE update, which will drop support for
shader translator output targetting GLSL versions lower than 150, we
now require a desktop GL context version of 3.2+ to run WebGL. This
means we should avoid setting the REQUIRE_COMPAT_PROFILE flag, as it
only requests a context version of 2.0.
This patch therefore removes the webgl.1.allow-core-profiles pref, and
instead always requests a core context. A consequence of this is that
we will now request core contexts even when the driver does in fact
support compat contexts of a sufficient version, but this should be
harmless.
When a driver does not support desktop GL 3.2, on EGL we will fall
back to attempting to create a GLES 2 context, which may still allow
users to run WebGL 1 on certain hardware.
As a precaution, the WebglAllowCoreProfile gfxVar is retained, which
is used to prevent us creating core contexts on buggy devices. If
this var were to be set false, a compat context would be succesfully
created, but WebGL would be blocked if the supported GLSL version is
insufficient (which would be preferable to creating a core context and
subsequently crashing). In practice, this is currently only set false
on old Mac hardware which is no longer supported.
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b09b207dd3ed
https://hg.mozilla.org/mozilla-central/rev/c8e83575beba
Updated•1 month ago
|
Description
•