benchmarks as well as some scripts to compile these and collect some statistics. Shader-db is intended to help validate an optimization. It was noticed that an unexpected number of shaders are not hand-written but generated. This means these shaders were originally written in HLSL and then translated into GLSL by some translator program, such as e.g. HLSL2GLSL. The problem is, that the generated code is often far from being optimal. Matt Turner said it was much easier to fix this in the translator program than having to make Mesa's compiler carry the burden of dealing with such bloated shaders. shader-db cannot be considered free and open-source software. To use it legally, one must have a license for all the computer games that the shaders are part of. Software architecture The so-called "user-mode graphics device drivers" (UMD) in Mesa have very few commonalities with what is generally called a device driver. There are a couple of differences: they are meant to work on top of additionally existent kernel mode graphics device drivers, that are e.g. available as part of the Linux kernel found in the source code under /drivers/gpu/drm/ Each UMD communicates with its kernel mode counterpart with the help of a specific library, name libdrm_specific and a generic one, named libdrm. This section shall look solely on the user-mode part above libdrm there is some implementation of the finite-state machine as specified by e.g. OpenGL; this implementation of the OpenGL state machine may be shared among multiple UMDs or not they consist to a great part of some sort of compiler, that ingests e.g. GLSL and eventually outputs machine code. Parsers may be shared among multiple UMD or be specific Mesa's Intermediate Representations One goal of Mesa is the optimization of code that is to be executed by the respective GPU. Another is the sharing of code. Instead of documenting the pieces of software, this article shall instead look at the Intermediate Representations used in the process of compiling and optimizing. See Abstract syntax tree (AST) and Static single assignment form (SSA form). SPIR-V SPIR-V is a certain version of the Standard Portable Intermediate Representation. The idea is, that graphics applications output SPIR-V instead of GLSL. In contrast to the latter, SPIR-V is binary to avoid implementation differences between GLSL compiler frontends of different driver implementations, as this has been a major source of application incompatibilities and bugs. Also SPIR-V