WebGL context creation fails under llvmpipe
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: jgilbert, Assigned: jgilbert)
Details
Attachments
(2 files, 1 obsolete file)
When running firefox with LIBGL_ALWAYS_SOFTWARE=1, webgl context creation fails.
It shouldn't.
Root cause:
Llvmpipe doesn't support ARB_robustness for contexts, though it understands the enums and requests, and just doesn't create a context if you ask for robustness. Per spec, glxCreateContextAttribs generates GLXBadFBConfig in this case.
On GLX today, if we see that GLX has GLX_ARB_create_context_robustness, we unconditionally add the robustness request to our context creation attribs, without implementing a fallback in case that fails.
Hence context creation fails on llvmpipe.
I added fallback code, and was still having issues.
The current code tries to create a context, but also looks for any errors after context creation and init is otherwise successful. If it finds an error, it cancels context creation after all.
Many GLX entrypoints including glxCreateContextAttribs generate an XErrorEvent when they fail, which gives us more info about the failure. (such as the error code, like GLXBadFBConfig)
I left the x-error-checking code in the base scope, so it accumulated an XErrorEvent for when glxCreateContextAttribs fails to create a context with robustness attribs.
This error checking code needed to be per-context-creation to work properly.
I ended up removing it this error checking though, since we can trivially tell whether glxCreateContextAttribs failed when its return value is null/zero.
Assignee | ||
Comment 1•3 years ago
|
||
Also trim out unused code/vars.
Also give better WebGL context creation errors.
Updated•3 years ago
|
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1bde1bcafcf1 For GLContextGLX creation, add fallback if robustness fails. r=lsalzman
Comment 3•3 years ago
|
||
Backed out changeset 1bde1bcafcf1 (Bug 1700799) for causing webgl crashes.
Backout link: https://hg.mozilla.org/integration/autoland/rev/ac07ec4704c41a9bc6c035653d32c29c1c28b587
Push with failures, failure log.
Assignee | ||
Comment 4•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5921d74fafb0 For GLContextGLX creation, add fallback if robustness fails. r=lsalzman https://hg.mozilla.org/integration/autoland/rev/cec5209c6a32 Better WebGL context creation failure messages. r=lsalzman
Comment 7•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5921d74fafb0
https://hg.mozilla.org/mozilla-central/rev/cec5209c6a32
Assignee | ||
Updated•3 years ago
|
Description
•