[Mesa-dev] WebGL test suite, and whitelisting drivers / OpenGL implementations in Firefox
bjacob at mozilla.com
Sun Jan 16 13:29:45 PST 2011
I realize that you may well not have time to care about WebGL  or
Firefox. In that case, I'm still writing because there's a new test
suite, namely the WebGL conformance test suite, that may be of interest
to help find and fix bugs in OpenGL implementations.
The goal of this email is to discuss steps towards whitelisting Xorg
OpenGL drivers for WebGL rendering, and more generally for all
OpenGL-based features, in Firefox. Although I'm only directly concerned
with Firefox, this really applies equally well to all browsers
OpenGL-based features are disabled by default in Firefox 4 on X11
because of OpenGL bugs we've hit , and currently only the NVIDIA
proprietary driver is whitelisted .
The good news is that there's a good official WebGL conformance test
suite, and that any driver passing (most of) it will be a great
candidate for whitelisting.
To run it and reproduce the issues we're having, you can follow these steps:
1. Download a nightly build of Firefox 4 there, and untar it:
2. Run it with the MOZ_GLX_IGNORE_BLACKLIST env variable, e.g.:
$ MOZ_GLX_IGNORE_BLACKLIST=1 ./firefox -P -no-remote
(-P allows you to create a fresh new profile and -no-remote
prevents attaching to existing firefox instance).
3. Go to this URL:
4. Click 'run tests'. If it doesn't crash and more than 90% tests
succeed, we can start discussing whitelisting, depending on what the
failures are (see below). Notice that this runs two sets of tests,
conformance/ and more/. Only conformance/ really matters. Also, a few
failures will be Firefox bugs (the WebGL conformance test suite is still
somewhat of a moving target) and some other failures may be bugs in the
tests themselves (this applies mostly to the tests under more/). To give
you an idea of what to aim for, here on debian sid x86-64 + NVIDIA
proprietary driver I get this:
Results: (5241 of 5315 passed, 3 timed out)
And among the conformance/ test pages, I get these failures on that system:
conformance/array-unit-tests.html (278 of 279 passed)
conformance/gl-get-active-attribute.html (19 of 22 passed)
conformance/gl-get-calls.html (73 of 75 passed)
conformance/gl-getshadersource.html (1 of 3 passed)
conformance/gl-uniform-bool.html (1 of 2 passed)
conformance/glsl-conformance.html (101 of 104 passed)
conformance/invalid-passed-params.html (50 of 74 passed)
conformance/is-object.html (24 of 25 passed)
conformance/read-pixels-test.html (121 of 125 passed)
conformance/uninitialized-test.html (11 of 19 passed)
conformance/webgl-specific.html (31 of 40 passed)
5. A few Firefox debugging infos/tips that you may find useful:
- when using OSMesa, the whole WebGL conformance test suite runs
without any legitimate valgrind errors .
- defining the MOZ_X_SYNC env variable enables XSynchronize
- when using a debug build of Firefox, defining MOZ_GL_DEBUG enables
a special "openGL debugging mode" that calls glFinish() after every GL
call, that checks that then OpenGL context that a GL call is supposed to
apply to is indeed the current context (or else it aborts), and that
logs GL errors. MOZ_GL_DEBUG_VERBOSE will log every GL call.
- debug builds of Firefox may be downloaded from
but they don't have debug symbols AFAIK. For that, you may need to make
your own build .
- to run firefox in GDB, do firefox -g. When attaching GDB to already
running firefox, attach to firefox-bin.
 See for example:
Also you may find this useful:
Sample query for all crashes in r600_dri.so in Firefox 4 ("branch
2.0") that are NOT caused by a plugin like Flash during the past week
(the low volume of crashes is explained by the fact that we're not
whitelisting this driver so only the few people running with
MOZ_GLX_IGNORE_BLACKLIST are exposed):
 The whitelisting code is currently there:
To anyone wanting to reproduce this, you need a recent Mesa (post bug
31837), a build of firefox with --enable-valgrind --disable-jemalloc,
and the valgrind suppressions file given on bug 588918.
More information about the mesa-dev