Closed Bug 1700799 Opened 3 years ago Closed 3 years ago

WebGL context creation fails under llvmpipe

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect

Tracking

()

RESOLVED FIXED
89 Branch
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.

Also trim out unused code/vars.
Also give better WebGL context creation errors.

Assignee: nobody → jgilbert
Status: NEW → ASSIGNED
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bde1bcafcf1
For GLContextGLX creation, add fallback if robustness fails. r=lsalzman
Flags: needinfo?(jgilbert)
Attachment #9211375 - Attachment is obsolete: true
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
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Flags: needinfo?(jgilbert)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: