Avoid loading unsuffixed GL entry points when function is available via extension but not core in current context version
Categories
(Core :: Graphics, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: jnicol, Assigned: jnicol)
References
Details
Attachments
(2 files)
This will avoid an issue when we next update ANGLE in bug 1908744.
As of this ANGLE change, validation when calling GLES entry points was made more strict. Calling an unsuffixed entry point for a function that is not core in the context's version will generate a GL_INVALID_OPERATION, even when the function is supported via an extension. In these cases we must make sure we load the suffixed versions instead.
The concrete cases where we run in to issues are with the KHR_debug symbols here, and glGetGraphicsResetStatus here.
In the KHR_debug case we at least check that the extension is supported before attempting to load symbols, but we attempt to load the unsuffixed symbols first. On ANGLE-on-D3D we have a GLES 3.0 context but it will successfully load the unsuffixed symbols, and then will raise an error whenever we attempt to call them, e.g. here.
In the glGetGraphicsResetStatus case we don't even do that - we just load the symbols without any checks. Again, loading the unsuffixed one first which is not supported in our context version.
In both these cases the solution is to check the context version prior to loading the symbols, and then attempt to load either the suffixed or unsuffixed versions depending on the version. In reality we should probably be even stricter, and only attempt to load the specific suffixed versions if their corresponding extension is supported, but in practice it seems okay without doing this.
| Assignee | ||
Comment 1•1 month ago
|
||
ANGLE has tightened the validation in their GLES entry points. As a
result, calling the unsuffixed entry point of a GL function that is
not core in the current context version will raise a
GL_INVALID_OPERATION error, even if the function is supported via an
extension. We must take care to load the appropriate suffixed entry
points instead.
GLContext's loader previously preferred loading the unsuffixed symbols
for KHR_debug, falling back to the KHR-suffixed symbols only if the
core symbols were absent. These functions were made core in GLES 3.2,
but when running ANGLE-on-D3D we only get a 3.0 context. When we next
update ANGLE, this will result in validation errors being raised
whenever they are called.
To fix this we create GLFeature::debug, and use fnLoadFeatureByCore()
to load either the core or extension symbols depending on whether the
feature is supported by core.
| Assignee | ||
Comment 2•1 month ago
|
||
Similar to the previous commit, loading then calling the unsuffixed
glGetGraphicsResetStatus symbol when that function is not core in the
current context version will result in a GL_INVALID_OPERATION error in
recent versions of ANGLE.
To avoid this we now only attempt to load the unsuffixed symbol on
supported context versions. GetGraphicsResetStatus is loaded before
GLFeatures are initialized, so unlike the previous patch where we used
fnLoadFeatureByCore(), we instead manually check the context version
prior to attempting the load.
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8b1377b0f149
https://hg.mozilla.org/mozilla-central/rev/f1fc99eb15b1
Updated•1 month ago
|
Description
•