If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Overhauling Mesa's GLSL Compiler Performance

Phoronix: Overhauling Mesa's GLSL Compiler Performance

We like hearing about performance improvements for Linux and also Linux graphics in general, but when there's something about performance improvements for Linux graphics, it certainly gets us excited and garners our interest. This time we get to report on work being done to Mesa's GLSL compiler, which is now running drastically faster in a branch of Mesa that will be published in about a week. Intel's Ian Romanick has been working on optimizing GLSL IR and reworking the assembly shader (among other things) after ditching his efforts to write a new GLSL compiler, but VMware's Michal Krol has been rewriting the GLSL compiler pre-processor for Mesa as a step towards improving the GL Shading Language support and making it easier to strap in a new syntax parser in the future. Once Michal wrote the new pre-processor, the existing syntax parser ended up being a huge bottleneck, and while Ian was going to be writing a new syntax parser, Michal ended up writing a new simple one...

With these improvements, shaders can be compiled faster, they do not magically compile into faster code. As most shaders are precompiled when the scene loads, you could expect games load times to go down, but usually the rendering speed should stay the same.

With these improvements, shaders can be compiled faster, they do not magically compile into faster code. As most shaders are precompiled when the scene loads, you could expect games load times to go down, but usually the rendering speed should stay the same.

Yeah, I too thought that the speedups were related to output shader code and not to the compilers itself, until I read the ml.

So what's this glsl-compiler actually good for?
AFAIK there's no mesa driver which actually supports glsl anyway? Except maybe the latest intels.
I still don't understand what is the missing piece for glsl on radeon-cards. Gallium3d seems to be coming along quite well, but from what I gathered in the last gallium3d-threads it's not actually going to give us glsl automagically.

I believe the missing piece for GLSL is driver support for some additional Mesa/TGSI IL instructions including things like flow control, plus the usual heap of testing and tweaking. The Mesa compiler processes application shader code into IL and passes that to the driver, which then compiles it again into native hardware instructions.