
Originally Posted by
allquixotic
Mesa started out as an OpenGL software renderer. Since then, it has grown into more of an umbrella project, supporting a lot of very different efforts under common infrastructure.
These days, the most popular use of Mesa is to start with a "low level" hardware interface to some graphics chipset; pull that low-level interface up into a common representation called the Gallium3d API (accompanied by TGSI intermediary representation); and then do "stuff" with that medium-level hardware interface.
The raw Gallium3d interface isn't generally useful to application programmers, because it's too low level and requires a lot of hardware knowledge. That's why we then write something called a "state tracker", which hooks into that mid-level tier and provides some kind of application developer interface in the form of a public library, such as OpenGL, OpenCL, OpenGL ES, OpenVG, and so on.
Actually, there are quite a lot of state trackers in existence right now. OpenGL is by far the most popular, the most heavily maintained and the least buggy (at least for more "mature" hardware); but the other state trackers are coming around gradually. I would wager that OpenCL is probably going to be the second or third most popular state tracker, with another popular one being the one that does hardware-accelerated video decoding (I think it's called the "vaapi state tracker"?)
The neat thing about the mid-level interface is that you don't normally have to write your state tracker code for each piece of hardware. You might have to special-case certain things in certain state trackers, but overall, the idea is that the TGSI and Gallium3d API layer reduces the amount of work that the developers have to do, in order to provide the state tracker on top of an "assumed complete" low-level hardware interface.
In an ideal world, you could bring up brand new GPU hardware support into Gallium3d by just writing the low-level, hardware-specific bits; and once that work was completed, all of the state trackers sitting on top of Gallium3d would light up, like power being supplied to a light bulb - ping!, you've got OpenGL; ping!, you've got OpenCL; ping!, you've got OpenVG; and so on. It doesn't exactly happen that way due to practicalities such as the low-level drivers being generally incomplete unless a specific feature is seen as needed (and then the feature is added in order to support a specific use case in a specific tracker); but as these kinds of efforts continue to expand, you will hopefully see the hardware-dependent entrails showing up less and less frequently in the layers sitting "above" the Gallium3d mid-level API. So it's kind of a work in progress, but it's a very powerful idea for saving development time.
So whenever you hear about someone trying to use some library with the aid of GPU acceleration, chances are that it's going to wind up as a Mesa state tracker. We even have a Direct3D 11 state tracker, hehe.