Mesa's DRIRC Options To Become More Driver-Agnostic
Written by Michael Larabel in Mesa on 6 June 2015 at 08:17 AM EDT. 1 Comment
There's good news for both Mesa users and developers when needing to workaround OpenGL bugs / buggy applications and games.

Mesa's DRIRC file allows for Mesa DRI drivers via driconf to workaround application bugs, such as issues for the older Unigine benchmarks with improper GLSL code. Maintaining DRIRC though is a mess when needing to come up with this quirk handling, but Martin Peres of Intel is hoping to improve the situation.

With a new patch series published on Friday he explained the situation:
Right now, adding a new drirc parameter is painful because it involvesadding a new entry in the gl constant structure, making sure that the field is set to the right value by default in osmesa drivers, adding the parameter in every driver's drirc xml and then reading the value at runtime to set it in the gl constant structure.

With such an error-prone process, it is no wonder that driver devs patched only their own driver and let the other driver devs patch their own driver. This led to drivers supporting very different options...

I set out to fix this issue when I wanted to introduce the equivalent of MESA_EXTENSION_OVERRIDE to drirc to make the older unigine benchmarks work. More recently, I also noticed I needed to add the equivalent of MESA_GL_VERSION_OVERRIDE which made it clearer than such a shared-options approach would be beneficial.

This series unifies most of the shared options, introduces two more options and finally fixes the unigine benchmarks!

Ultimately, I would like us to move away from environment variables to use more the drirc options which can be set per-application through the drirc file or by using an environment variable.
More details here with the sixteen patches that adjust a few hundred lines of Mesa code.
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter or contacted via

Popular News This Week