[Mesa-dev] Mesa llvmpipe for WebGL software rendering

Jose Fonseca jfonseca at vmware.com
Tue Feb 28 09:45:00 PST 2012


----- Original Message -----
> Hi List,
> 
> At Mozilla we've been wondering if we could get a good software
> fallback for users who can't get hardware-accelerated WebGL. Mesa
> llvmpipe seems like the best open source OpenGL renderer, right? At
> least, it performed superbly in our quick tests.

It's in the my knowledge the fastest open-source renderer for shaders (i.e., non-fixed function).  I think the old Mesa software renderer is faster for some fixed function cases, as it has special hand written paths for that.

I'd definitely be interested in seeing llvmpipe to be used as much as possible, in particular Mozilla.

> Questions:
>  
>  1. Is it possible for the application to choose between Mesa
>  renderers? Ideally I would like to be able to evaluate the driver
>  blacklist, and depending on that, use either the default renderer
>  or Mesa llvmpipe. Is that possible?

With DRI drivers I believe there is an environment variable to force software renderer -- you could set it within mozilla process --, but you'll need to check the renderer, as it may not be llvmpipe.

llvmpipe can also be built as drop-in replacement for libGL.so/opengl32, which could be shipped/bundled separately:

- On Linux it would be a matter of dlopen() pure llvmpipe's libGL.so.

- On windows it would be a matter to LoadLibraryA()'s llvmpipe opengl32.dll instead of MS's.

>  2. Related question: are you planning to update OSMesa, base it on
>  llvmpipe? Last I checked, OSMesa was based on swrast from an old
>  Mesa version. An updated OSMesa would offer a great solution to
>  question 1.

I'm not very familiar with OSMesa myself, but it is relatively small component on top of the Mesa stack, so it should be easy to adapt OSMesa to use gallium (hence llvmpipe).

I think it boils down more to a choice of whether to bundle llvmpipe or rely on system's, rather than a feasibility issue.

>  3. On GNU/Linux: why isn't Mesa llvmpipe installed by default by
>  most distros? Is there a real reason or is it just that nobody
>  asked for it, or nobody saw a need for it? Trying to figure if
>  llvmpipe installed by default everywhere (on Linux) is something we
>  can realistically hope for.

Don't know. Maybe it is the LLVM dependency that caused problems for distros. Or the mere fact that most people have HW GPUs on their desktops, which llvmpipe really can't compete with shoulder to shoulder, so everybody (both distros and users) have been more focused in having decent HW rendering, than fastest SW rendering.

But llvmpipe is becoming more prevalent now.

>  4. On Windows, which is where we have the biggest problems with
>  outdated drivers, is Mesa/llvmpipe available? 

Yep. See:
- http://www.mesa3d.org/install.html#scons
- http://www.mesa3d.org/llvmpipe.html

You'll need LLVM for windows too of course.

> What form does it
>  take? (Question 2. would offer an answer to this, OSMesa...)

It takes a form of a dropin replacement DLL for Microsoft's opengl32.dll (glXxxx and wglXxxx entrypoints) a IHV's ICD driver (DrvXxxxx entrypoints).

Jose


More information about the mesa-dev mailing list