Mesa (computer graphics)

(Redirected from Mesa 3D)
Jump to: navigation, search
Original author(s) Brian Paul
Developer(s) Currently: Intel, AMD, VMware
Formerly: Tungsten Graphics[1]
Initial release August 1993 (1993-08)[2]
Stable release
17.3.2 / January 9, 2018 (2018-01-09)[3]
Preview release
17.3.0 / December 8, 2017 (2017-12-08)[4]
Repository Edit this at Wikidata
Development status Active
Written in C, C++, Assembly[5]
Operating system Cross-platform (BSDs, Haiku, Linux, et al.)
Type Graphics library
License MIT License[6]

Mesa, also called Mesa3D and The Mesa 3D Graphics Library, is an open-source device driver and software implementation of the OpenGL, Vulkan and other specifications. Its most important user surfacing parts are the two graphics drivers mostly developed and funded by Intel and AMD, which are using those implementations. The smaller GeForce graphics driver Nouveau in contrast is mostly a community effort. Mesa implements a cross-language, cross-platform (mostly on BSD and Linux distributions), vendor-neutral standard API for interfacing with diverse vendor-specific graphics hardware drivers.

Besides 3D applications such as games, modern display servers ('s Glamor or Wayland's Weston) use OpenGL/EGL; therefore all graphics typically go through Mesa. Proprietary graphics drivers (e.g. Nvidia GeForce driver and AMD Catalyst for Radeon) replace all of Mesa, providing their own implementation of a graphics API, rather than providing a driver that Mesa talks to. While Nvidia today promotes its proprietary driver for gaming, AMD promotes their Mesa drivers (radeon and radeonSI) over the deprecated AMD Catalyst (formerly fglrx).

Mesa is hosted by and was initiated in August 1993 by Brian Paul, who is still active in the project. Mesa was subsequently widely adopted, and now contains numerous contributions from various individuals and corporations worldwide, including from the graphics hardware manufacturers of the Khronos Group that administer the OpenGL specification. For Linux, development has also been partially driven by crowdfunding.[7]


Video games outsource rendering calculations to the GPU over OpenGL in real-time. Shaders are written in OpenGL Shading Language or SPIR-V and compiled on the CPU. The compiled programs are executed on the GPU.
Illustration of the Linux graphics stack: DRM & libDRM, Mesa 3D. Display server belongs to the windowing system and is not necessary e.g. for gaming.

Implementations of rendering APIs

The free implementations of Wayland rely upon the Mesa implementation of EGL. The special library called libwayland-EGL, written to accommodate access to the framebuffer, should have been made obsolete by the EGL 1.5 release. On the GDC 2014, AMD was exploring a strategy change towards using DRM instead of their in-kernel blob.[8]

Mesa is known as housing implementation of graphic APIs. Historically the main API that Mesa has implemented is OpenGL, along with other Khronos Group related specifications (like OpenVG, OpenGL ES or recently EGL). But Mesa can implement other APIs and indeed it did with Glide (deprecated) and Direct3D 9 (since July 2013.[9]). Mesa is also not specific to Unix-like operating systems: on Windows for example, Mesa provides an OpenGL API over DirectX.

Mesa implements a translation layer between a graphics API such as OpenGL and the graphics hardware drivers in the operating system kernel. The supported version of the different graphic APIs depends on the driver, because each hardware driver has its own implementation (and therefore status). This is specially true for the "classic" drivers, while the Gallium3D drivers share common code that tend to homogenize the supported extensions and versions.

Mesa maintains a support matrix with the status of the current OpenGL conformance[10][11] visualized at Mesa 10 complies with OpenGL 3.3, for Intel, AMD/ATI and Nvidia GPU hardware. Mesa 11 was announced with some drivers being OpenGL 4.1 compliant.[12]

Mesa 12 contains OpenGL 4.2 and 4.3 and Intel Vulkan 1.0 support.

Mesa 13 brought Intel support for OpenGL 4.4 and 4.5 (all Features supported for Intel Gen 8+, Radeon GCN, Nvidia (Fermi, Kepler), but no Khronos-Test for 4.5-Label) and experimental AMD Vulkan 1.0 support through the community driver RADV. OpenGL ES 3.2 is possible with Intel Skylake (Gen9).[13]

Actual stable Version is 17.0 (new year Counting).[14][15][16] Ready features are certified OpenGL 4.5, OpenGL 4.5 for Intel Haswell,[17][18] OpenGL 4.3 for NVidia Maxwell and Pascal (GM107+).[19] Huge performance gain was measured with Maxwell 1 (GeForce GTX 750 Ti and more with GM1xx). Maxwell-2-Cards (GeForce GTX 980 and more with GM2xx) are underclocked without NVidia information.[20]

The Khronos CTS test suite for OpenGL 4.4, 4.5 and OpenGL ES 3.0+ is in now (2017-01-24) Open Source and all tests for Mesa 13 and 17 are now possible without costs.[21]

A new version, 17.1.0, came out on 10th May 2017 with some interesting improvements. OpenGL 4.2+ for Intel Ivy Bridge and OpenGL 3.3+ for Intel Open SWR Rasterizer are 2 of the highlights.[22][23]

Note that due to the modularized nature of OpenGL, Mesa can actually support extensions from newer versions of OpenGL without claiming full support for such versions. For example, in July 2016, Mesa supported OpenGL ES 3.1 but also all OpenGL ES 3.2 extensions except for five, as well as a number of extensions not part of any OpenGL or OpenGL ES version.[24]

An open question for Mesa and Linux is High Dynamic Range (HDR). Many problems and open points are in pipe for a clean and basic implementation.[25]

Version 17.2 is available since September 2017 with some new OpenGL 4.6 features and velocity improvements in 3D for Intel and AMD.

Version 17.3 is ready since December 2017. Many improvements in many Drivers are available. OpenGL 4.6 is nearly full available (Spir-V not ready). AMD Vulkan Driver RADV is now Full conformant in Khronos-Test.[26]

Next Version 18.0 is planned in calendar in March 2018 by same scheme in 2017.[27]

Table of Rendering APIs

API Vulkan OpenCL OpenGL OpenGL ES OpenVG EGL GLX Direct3D
Version First Release Date Last update 1.0
Future release: 18.0 2018-03-01 in Dev. 18.0.0 1.0 1.0, 1.1, 1.2 (WIP) 4.6+ ? 3.2+ N/A 1.5 1.4 9.0c
Current stable version: 17.3 2017-12-08 17.3.2[28][29][30] 1.0 (PC: Intel and AMD only) in dev. by Gallium
Compute (Clover):
work in (very slow) progress
1.0, 1.1, 1.2[31][32]
4.5 (+ extra ARBs) 3.2 (+ extra ARBs and OES) N/A[33] 1.5 1.4 9.0c[34][35]
Older version, yet still supported: 17.2 2017-09-04 17.2.8[36][37][38][39][40][41][42][43][44]
Old version, no longer supported: 17.1 2017-05-10 17.1.10[45][46][47][48][49][50][51][52][53][54][55][56]
Old version, no longer supported: 17.0 2017-02-13[57][14] 17.0.7[58][59][60][61][62][63][64][65][66]
Old version, no longer supported: 13.0 2016-11-01[67] 13.0.6[68][69][70][71][72][73] 4.4
(4.5 No Test Label)
Old version, no longer supported: 12.0 2016-07-08[74] 12.0.6[75][76][77][78][79][80] 4.3[74] 3.1
Old version, no longer supported: 11.2 2016-04-04[81] 11.2.2 N/A 4.1 (Intel 3.3+)[82]
Old version, no longer supported: 11.1 2015-12-15[83] 11.1.4 3.0
Old version, no longer supported: 11.0 2015-09-12[84] 11.0.9
Old version, no longer supported: 10.6 2015-06-15[85] 10.6.9 3.3[86] 1.4
Old version, no longer supported: 10.5 2015-03-06[87] 10.5.9 1.1
Old version, no longer supported: 10.4 2014-12-14[88] 10.4.7
Old version, no longer supported: 10.3 2014-09-19[89] 10.3.7 N/A
Old version, no longer supported: 10.2 2014-06-06[90] 10.2.9
Old version, no longer supported: 10.1 2014-03-04[91] 10.1.6
Old version, no longer supported: 10.0 2013-11-30[92] 10.0.5
Old version, no longer supported: 9.0 2012-10-08 9.0.3, 9.1.7, 9.2.5 N/A 3.1[93] 2.0
Old version, no longer supported: 8.0 2012-02-08 8.0.5 3.0
Old version, no longer supported: 7.0 2007-06-22 7.0.4, ..., 7.11.2 2.1 N/A N/A N/A
Old version, no longer supported: 6.0 2004-01-06 6.0.1 1.5 1.3
Old version, no longer supported: 5.0 2002-11-13 5.0.2 1.4
Old version, no longer supported: 4.0 2001-10-22 4.0.4 1.3
Old version, no longer supported: 3.0 1998-09-01 3.1, 3.2.1, 1.2
Old version, no longer supported: 2.0 1996-10-01 2.6 1.1
Old version, no longer supported: 1.0 1995-02-01 1.2.8 1.0
Old version
Older version, still supported
Latest version
Latest preview version
Future release


The Khronos Group officially announced Vulkan API in March 2015, and officially released Vulkan 1.0 on February 16, 2016. Vulkan breaks compatibility with OpenGL and completely abandons its monolithic state machine concept. The developers of Gallium3D called Vulkan to be something along the lines of Gallium3D 2.0 – Gallium3D separates the code that implements the OpenGL state machine from the code that is specific to the hardware.

As Gallium3D ingests TGSI, Vulkan ingests SPIR-V (Standard Portable Intermediate Representation version "V" as in "Vulkan").

Intel released their implementation of a Vulkan driver for their hardware the day the specification was officially released, but it was only mainlined in April and so became part of Mesa 12.0, released in July 2016. While already the i965 driver wasn't written according to the Gallium3D specifications, for the Vulkan driver it makes even less sense to flange it on top of Gallium3D. Similarly there is no technical reason to flange it with NIR, but yet Intel's employees implemented their Vulkan driver that way.[94]

It is to be expected that AMD's own proprietary Vulkan driver, which was released in March, and was announced to be released as free and open-source software in the future and be mainlined into Mesa, also abandons Gallium3D.[95]

RADV is a free Project in Beta Status for AMD and available in Version 13.[13] Conformant with Khronos-Test is actual Version 17.3.

Nvidia released their proprietary GeForce driver with Vulkan support at launch day and Imagination Technologies (PowerVR), Qualcomm (Adreno) and ARM (Mali) have done the same or at least announced proprietary Vulkan drivers for Android and other operating systems. But when and whether additional free and open-source Vulkan implementations for these GPUs will show up, remains to be seen.

Explicit fencing

A kind of memory barrier which separates one buffer from the rest of the memory is called a fence. Fences are there to ensure that a buffer is not being overwritten before rendering and display operations have completed on it. Implicit fencing is used for synchronization between graphics drivers and the GPU hardware. The fence signals when a buffer is no longer being used by one component so it can be operated on or reused by another. In the past the Linux kernel had an implicit fencing mechanism, where a fence is directly attached to a buffer (cf. GEM handles and FDs), but userspace is unaware of this. Explicit fencing exposes fences to userspace, where userspace gets fences from both the Direct Rendering Manager (DRM) subsystem and from the GPU. Explicit fencing is required by Vulkan and offers advantages for tracing and debugging.

Linux kernel 4.9 added Android's synchronization framework to mainline.[96]

Generic Buffer Management

Generic Buffer Management (GBM) is an API which provides a mechanism for allocating buffers for graphics rendering tied to Mesa. GBM is intended to be used as a native platform for EGL on drm or openwfd. The handle it creates can be used to initialize EGL and to create render target buffers.[97]

Mesa GBM is an abstraction of the graphics driver specific buffer management APIs (for instance the various libdrm_* libraries), implemented internally by calling into the Mesa GPU drivers.

For example, the Wayland compositor Weston does its rendering using OpenGL ES 2, which it initializes by calling EGL. Since the server runs on the "bare KMS driver", it uses the EGL DRM platform, which could really be called as the GBM platform, since it relies on the Mesa GBM interface.

At XDC2014, Nvidia employee Andy Ritger proposed to enhance EGL in order to replace GBM.[98]

Implementations of video acceleration APIs

There are three possible ways to do the calculations necessary for the encoding and decoding of video streams:

  1. use a software implementation of a video compression or decompression algorithm (commonly called a CODEC) and execute this software on the CPU
  2. use a software implementation of a video compression or decompression algorithm (commonly called a CODEC) and execute this software on the GPU (the 3D rendering engine)
  3. use a complete (or partial) hardware implementation of a video compression or decompression algorithm; it has become very common to integrate such ASICs into the chip of the GPU/CPU/APU/SoC and therefore abundantly available; for marketing reasons companies have established brands for their ASICs, such as PureVideo (Nvidia), Unified Video Decoder (AMD), Video Coding Engine (AMD), Quick Sync Video (Intel), DaVinci (Texas Instruments), CedarX (Allwinner), Crystal HD (Broadcom); some ASICs are available for licensing as semiconductor intellectual property core; usually different versions implement different video compression and/or video decompression algorithms; support for such ASICs usually belong into the kernel driver, to initialize the hardware and do low-level stuff. Mesa, which runs in user-space, houses the implementations of several APIs for software, e.g. VLC media player, GStreamer, HandBrake, etc., to conveniently access such ASICs:

For example, Nouveau, which has been developed as part of Mesa, but also includes a Linux kernel component, which is being developed as part of the Linux kernel, supports the PureVideo-branded ASICs and provides access to them through VDPAU and partly through XvMC.[99]

The free radeon driver supports Unified Video Decoder and Video Coding Engine through VDPAU and OpenMAX.[100]

Please note, that V4L2 is a kernel-to-user-space interface for video bit streams delivered by webcams or TV tuners.

Device drivers

Graphics device drivers are implemented using two components: a UMD (user-mode driver) and a KMD (kernel-mode driver). Starting with Linux kernel 4.2 AMD Catalyst and Mesa will share the same Linux kernel driver: amdgpu. Amdgpu provides interfaces defined by DRM and KMS.

The available free and open-source device drivers for graphic chipsets are "stewarded" by Mesa (because the existing free and open-source implementation of APIs are developed inside of Mesa). Currently there are two frameworks to write graphics drivers: "classic" and Gallium3D.[101] An overview over some (but not all) of the drivers available in Mesa is given at

There are device drivers for AMD/ATI R100 to R800, Intel, and Nvidia cards with 3D acceleration. Previously drivers existed for the IBM/Toshiba/Sony Cell APU of the PlayStation 3, S3 Virge & Savage chipsets, VIA chipsets, Matrox G200 & G400, and more.[102]

The free and open-source drivers compete with proprietary closed-source drivers. Depending on the availability of hardware documentation and man-power, the free and open-source driver lag behind more or less in supporting 3D acceleration of new hardware. Also, 3D rendering performance was usually significantly slower with some notable exceptions.[103][104][105][106] Today this is still true for Nouveau for most NVIDIA GPUs while on AMDs Radeon GPUs the open driver now mostly matches or exceeds the proprietary driver's performance.

Direct Rendering Infrastructure (DRI)

At the time 3D graphics cards became more mainstream for PCs, individuals partly supported by some companies began working on adding more support for hardware-accelerated 3D rendering to Mesa.[when?] The Direct Rendering Infrastructure (DRI) was one of these approaches to interface Mesa, OpenGL and other 3D rendering API libraries with the device drivers and hardware. After reaching a basic level of usability, DRI support was officially added to Mesa. This significantly broadened the available range of hardware support achievable when using the Mesa library.[107]

With adapting to DRI, the Mesa library finally took over the role of the front end component of a full scale OpenGL framework with varying backend components that could offer different degrees of 3D hardware support while not dropping the full software rendering capability. The total system used many different software components.[107]

While the design requires all these components to interact carefully, the interfaces between them are relatively fixed. Nonetheless, as most components interacting with the Mesa stack are open source, experimental work is often done through altering several components at once as well as the interfaces between them. If such experiments prove successful, they can be incorporated into the next major or minor release. That applies e.g. to the update of the DRI specification developed in the 2007-2008 timeframe. The result of this experimentation, DRI2, operates without locks and with improved back buffer support. For this, a special git branch of Mesa was created.[108]

DRI3 is supported by the Intel driver since 2013[109][110] and is default in some Linux distributions since 2016[111] to enable Vulkan support and more. It is also default on AMD hardware since late 2016 (X.Org Server 1.18.3 and newer).[112]

Software renderer

Software rendering is the misleading term, when shaders are executed on the CPU instead of the GPU. Mesa also contains an implementation of software rendering that allows shaders to run on the CPU as a fallback when no graphics hardware accelerators are present called swrast. The Gallium software rasterizer is known as softpipe or when built with support for LLVM llvmpipe which generates CPU code at runtime.[113][114] Since Mesa 10.x OpenGL 3.3+ is supported for Softpipe (10.3) and LLVMpipe (10.2). Actual about 80% of Features from OpenGL 4.x are implemented in Mesa 17.3 (See Mesamatrix).

In Mesa 12.0 a new Intel Rasterizer OpenSWR is available with high advantages in clusters for large data sets. It's more focused on engineering visualisation than in game or art imagery and can only work on x86 processors.[115] On the other hand, OpenGL 3.1+ is now supported.[116] Acceleration values from 29 to 51 related to LLVMPIPE were measured in some examples.[117] Only change to option "GALLIUM_DRIVER="swr" is necessary. OpenGL 3.3+ is supported for OpenSWR since Mesa 17.1.

Mega drivers

The idea of bundling multiple drivers into a single "mega" driver was proposed by Eric Anholt. It allows for a single copy of the shared Mesa code to be used among multiple drivers (instead of it existing in each driver separately) and offering better performance than a separate shared library due to the removal of the internal library interface.[118] The state trackers for VDPAU and XvMC have become separate libraries.[119]


shader-db is a collection of about 20,000 shaders gathered from various computer games and 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. At least the Valve Corporation has granted all Mesa and all Debian developers free personal licenses for all the games distributed on Steam.

Software architecture

A graphics drivers consists of an implementation of the OpenGL state machine and a compilation stack to compile the shaders into the GPU's machine language. This compilation as well as pretty much anything else is executed on the CPU, then the compiled shaders are sent to the GPU and are executed by it. (SDL = Simple DirectMedia Layer).
The Intermediate Representations (IRs) in Mesa: GLSL IR, Mesa IR, TGSI, and LLVM IR. Missing are HIR, LIR and NIR.
Mesa IR is due to be removed completely.

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, that do this or that, this Wikipedia 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 is a certain version of the Standard Portable Intermediate Representation. The idea is, that game engines output SPIR-V instead of GLSL. In contrast to the latter, SPIR-V is binary to protect intellectual property and is already the result of general optimizations. A UMD needs only apply optimizations, that are specific to the supported hardware.


Mesa IR



The Tungsten Graphics Shader Infrastructure (TGSI) was introduced in 2008 by Tungsten Graphics. All Gallium3D-style UMDs ingest TGSI.


The UMDs radeonsi and llvmpipe do not output machine code, but instead LLVM IR. From here on, LLVM does optimizations and the compilation to machine code. This does mean, that a certain minimum version of LLVM has to be installed as well.

Mesa's GLSL compiler

Mesa's GLSL compiler generates its own IR. Because each driver has very different requirements from a LIR, it differentiates between HIR (high-level IR) and LIR (low-level IR).


Original author(s) Tungsten Graphics (now VMware)
Preview release
0.4[120] / April 24, 2010 (2010-04-24)
Repository Edit this at Wikidata
Written in C
Operating system Cross-platform
Type Graphics library
License MIT License

Gallium3D is a set of interfaces and a collection of supporting libraries[121] intended to ease the programming of device drivers for 3D graphics chipsets for multiple operating systems, rendering or video acceleration APIs.

A feature matrix is being provided at GalliumStatus, and the efforts of writing free and open-source device drivers for graphics chips is being separately documented in the Wikipedia: Free and open-source graphics device driver.

The development of Gallium3D started in 2008 at Tungsten Graphics,[122] and the implementation is available as free and open-source software as part of Mesa 3D hosted by The primary goal of making driver development easier, bundling otherwise duplicated code of several different drivers at a single point, and to support modern hardware architectures. This is done by providing a better division of labor, for example, leaving memory management to the kernel DRI driver.

Gallium3D has been a part of Mesa since 2009[123] and is currently used by the free and open-source graphics driver for Nvidia (nouveau project),[124][125] for R300R900,[126][127][128] and for other free and open-source GPU device drivers.

Software architecture

Gallium3D eases programming of device drivers by splitting the graphics device driver into three parts. This is accomplished by the introduction of two interfaces: Gallium3D State Tracker Interface and the Gallium3D WinSys Interface. The three components are called:

Gallium3D State Tracker
Each graphical API by which a device driver is being addressed has its own State Tracker, e.g. there is a Gallium3D State Tracker for OpenGL and a different one for Direct3D or GLX. Each State Tracker contains an implementation of the Gallium3D State Tracker Interface, and is unique, this means is shared by all existent Gallium3D device drivers.
Gallium3D hardware device driver
This is the actual code, that is specific to the underlying 3D graphic accelerator, but only as far as the Gallium3D WinSys Interface allows. There is a unique Gallium3D hardware device driver for each available graphics chip and each implements the Gallium3D State Tracker Interface as well as the Gallium3D WinSys Interface. The Gallium3D hardware device driver understands only TGSI (Tungsten Graphics Shader Infrastructure), an intermediate language for describing shaders. This code translated shaders translated from GLSL into TGSI further into instruction set implemented by the GPU.
Gallium3D WinSys
This is specific to the underlying kernel of the operating system and each one implements the Gallium3D WinSys Interface to interface with all available Gallium3D hardware device drivers.
VC4 and freedreno can both consume NIR directly (and fall back to tgsi_to_nir for shaders which do not use glsl_to_nir).
Illustration of the Linux graphics stack
Mesa /DRI and Gallium3D have different driver models. Both share a lot of free and open-source code
A possible example matrix when implementing the Gallium3D driver model. Through the introduction of the Gallium3D Tracker Interface and the Gallium3D WinSys Interface, only 18 instead of 36 modules are required. Each WinSys module can work with each Gallium3D device driver module and with each State Tracker module.

Differences from classic graphics drivers

Gallium3D provides a unified API exposing standard hardware functions, such as shader units found on modern hardware. Thus, 3D APIs such as OpenGL 1.x/2.x, OpenGL 3.x, OpenVG, GPGPU infrastructure or even Direct3D (as found in the Wine compatibility layer) will need only a single back-end, called a state tracker, targeting the Gallium3D API. By contrast, classic-style DRI device drivers require a different back-end for each hardware platform and several other APIs need translation to OpenGL at the expense of code duplication.[129][130][131] All vendor device drivers, due to their proprietary and closed-source nature, are written that way meaning that, e.g. the AMD Catalyst implements both OpenGL and Direct3D, and the vendor drivers for the GeForce have their implementations.

Under Gallium3D, Direct Rendering Manager (DRM) kernel drivers will manage the memory and Direct Rendering Interface (DRI2) drivers will be more GPU processing oriented.[132] During the transition period from userspace modesetting to kernelspace modesetting some of the Mesa 3D drivers, such as the radeon driver or Intel's drivers, ended up supporting both DRI1 and DRI2 and used DRI2 if available on the system. Gallium3D additionally requires a level of shader support that is not available on older cards like e.g. ATi r100-r200 so users for those cards need to keep using Mesa 3D with DRI2 for their 3D usage.

Tungsten Graphics Shader Infrastructure

Tungsten Graphics Shader Infrastructure (TGSI) is an Intermediate representation like LLVM Intermediate Representation or the new Standard Portable Intermediate Representation (SPIR) to be used by the Vulkan API and OpenCL 2.1. Shaders written in OpenGL Shading Language are to be translated/compiled into TGSI, then optimizations are made, and then the TGSI shaders are being compiled into shaders for the instruction set of the used GPU.

LLVM usage

GlassyMesa is an LLVM-based compiler stack for shaders written in GLSL. For SSA see the article Static single assignment form.

In addition, using the modular structure of Gallium3D, there is an effort underway to use the LLVM compiler suite and create a module to optimize shader code on the fly.[133]

The library represents each shader program using an extensible binary intermediate representation called Tungsten Graphics Shader Infrastructure (TGSI) which LLVM then translates into GLSL shaders optimized for target hardware.


Several free and open-source graphics device drivers, which have been, or are being written based on information gained through clean-room reverse engineering, adopted the driver model provided by Gallium3D, e.g. nouveau and others (see Free and open-source graphics device driver for a complete list). The main reason may be that the Gallium3D driver model lessens the amount of code required to be written.[original research?] Of course, being licensed under a free software license, this code can at any time by anybody be rewritten to implement the DRI-, or some other, driver model.


Original authors of Gallium3D were Keith Whitwell and Brian Paul at Tungsten Graphics (acquired by VMware in 2008.[134]


As of fall 2011, there were at least 10 known, mature and working Gallium3D drivers.[135][not in citation given][citation needed] Open-source drivers for Nvidia graphics cards by the name of Nouveau team develops its drivers using the Gallium3D framework.[125][136]

2008-07-13: Nouveau development is done exclusively for the Gallium framework. The old DRI driver was removed from the master branch of the Mesa repository on[137]

2009-02-11: The gallium-0.2 branch was merged into mainline Master branch of Mesa.[138] Development is done in Mesa mainline.

2009-02-25: Gallium3D can run on Linux as well as FreeBSD kernels.[139]

2009-05-01: Zack Rusin from Tungsten Graphics added the OpenVG state tracker to Mesa 3D,[140] which enables Scalable Vector Graphics to be hardware-accelerated by any Gallium3D-based driver.

2009-07-17: Mesa3D 7.5 is released, the first version to include Gallium3D.[141]

2010-09-10: Initial support for the Evergreen GPUs was added to the r600g driver.[142]

2010-09-21: There are two Gallium3D drivers for ATI hardware known as r300g and r600g for R300-R500 and R600-Evergreen GPUs respectively.

2010-09-21: Major commits were made to the code to support Direct3D 10 and 11.[143] In time, this might offer the ability to use recent Direct3D implementations on GNU/Linux systems.

2011-11-30: Intel 965g and Cell Gallium drivers were removed from the master branch of Mesa as unmaintained and broken.[144][145]

2014-11-18: Major commits were made to the code to support Direct3D 9.[146]



Project initiator Brian Paul was a graphics hobbyist. He thought it would be fun to implement a simple 3D graphics library using the OpenGL API, which he might then use instead of VOGL (very ordinary GL Like Library).[2] Beginning in 1993, he spent eighteen months of part-time development before he released the software on the Internet. The software was well received, and people began contributing to its development. Mesa started off by rendering all 3D computer graphics on the CPU. Despite this, the internal architecture of Mesa was designed to be open for attaching to graphics processor-accelerated 3D rendering. In this first phase, rendering was done indirectly in the display server, leaving some overhead and noticeable speed lagging behind the theoretical maximum. The Diamond Monster 3D, using the Voodoo Graphics chipset, was one of the first 3D hardware devices supported by Mesa.

The first true graphics hardware support was added to Mesa in 1997, based upon the Glide API for the then new 3dfx Voodoo I/II graphics cards and their successors.[107] A major problem of using Glide as the acceleration layer was the habit of Glide to run full screen, which was only suitable for computer games. Further, Glide took the lock of the screen memory, and thus the display server was blocked from doing any other GUI tasks.[147]

See also


  1. ^ Marshall, David (2008-12-16). "VMware's year end acquisition of Tungsten Graphics". InfoWorld. Retrieved 2011-08-06. 
  2. ^ a b "Mesa Introduction". Mesa Team. Retrieved 2015-06-08. 
  3. ^
  4. ^ "[Mesa-announce] mesa 17.3.0". Retrieved 2017-12-08. 
  5. ^ "Mesa Languages Page". Open Hub. Retrieved 2015-03-02. 
  6. ^ "Mesa 3D license". Retrieved 2015-06-03. 
  7. ^ "Improve OpenGL support for the Linux Graphics Drivers - Mesa". Indiegogo. 2013-12-11. Retrieved 2015-01-21. 
  8. ^ "AMD exploring new Linux driver Strategy". 2014-03-22. Retrieved 2014-03-23. 
  9. ^
  10. ^ "mesa/mesa - The Mesa 3D Graphics Library". Retrieved 2016-11-02. 
  11. ^ "The OpenGL vs Mesa matrix". 2015-03-25. Retrieved 2015-03-29. 
  12. ^ "Mesa 11.0 Has Been Branched, The Release March Begins". 2015-08-22. Retrieved 2015-08-22. 
  13. ^ a b
  14. ^ a b "Mesa 17.0.0 Officially Released". Phoronix. 2017-02-13. Retrieved 2017-02-13. 
  15. ^
  16. ^
  17. ^
  18. ^
  19. ^
  20. ^
  21. ^
  22. ^
  23. ^
  24. ^ "The OpenGL vs Mesa matrix". Retrieved 2016-07-31. 
  25. ^
  26. ^
  27. ^
  28. ^
  29. ^
  30. ^
  31. ^
  32. ^
  33. ^ Larabel, Michael (4 March 2015). "OpenVG Support Stripped From Gallium3D". Phoronix. Retrieved 11 July 2015. 
  34. ^ "latest patches to "nine" state tracker". 2016-02-04. 
  35. ^ Larabel, Michael (14 December 2014). "Mesa 10.4 Officially Released With Direct3D 9 State Tracker". Phoronix. Retrieved 11 July 2015. 
  36. ^
  37. ^
  38. ^
  39. ^
  40. ^
  41. ^
  42. ^
  43. ^
  44. ^
  45. ^
  46. ^
  47. ^
  48. ^
  49. ^
  50. ^
  51. ^
  52. ^
  53. ^
  54. ^
  55. ^
  56. ^
  57. ^ "[Mesa-announce] mesa 17.0.0". Retrieved 2017-02-13. 
  58. ^
  59. ^
  60. ^
  61. ^
  62. ^
  63. ^
  64. ^
  65. ^
  66. ^
  67. ^ "[Mesa-announce] mesa 13.0.0". Retrieved 2016-11-02. 
  68. ^
  69. ^
  70. ^
  71. ^
  72. ^
  73. ^
  74. ^ a b "Mesa 12.0 Released With OpenGL 4.3 Support, Intel Vulkan & Many Other Features". 2016-07-08. Retrieved 2016-07-08. 
  75. ^
  76. ^
  77. ^
  78. ^
  79. ^
  80. ^
  81. ^ "[Mesa-announce] Mesa 11.2.0". Retrieved 2016-04-04. 
  82. ^
  83. ^ "[Mesa-announce] Mesa 11.1.0". Retrieved 2015-12-15. 
  84. ^ "[Mesa-announce] Mesa 11.0.0". Retrieved 2015-09-26. 
  85. ^ "[Mesa-announce] Mesa 10.6.0". Retrieved 2015-06-15. 
  86. ^ Larabel, Michael (2013-10-26). "Features To Be Found In Mesa 10.0". Phoronix. 
  87. ^ "[Mesa-announce] Mesa 10.5.0". Retrieved 2015-03-07. 
  88. ^ "[Mesa-announce] Mesa 10.4.0 released". Retrieved 2015-03-07. 
  89. ^ "[Mesa-announce] Mesa 10.3 released". Retrieved 2015-03-07. 
  90. ^ "[Mesa-announce] Mesa 10.2 released". Retrieved 2015-03-07. 
  91. ^ "[Mesa-announce] Mesa 10.1 released". Retrieved 2015-03-07. 
  92. ^ "[Mesa-announce] Mesa 10.0 released". Retrieved 2015-03-07. 
  93. ^ "Mesa 9.0 Release Notes". Mesa. 8 October 2012. Retrieved 11 July 2015. 
  94. ^
  95. ^
  96. ^ "Bringing Android explicit fencing to the mainline". 2016-10-05. 
  97. ^ "libgbm in the Debian repositories". 
  98. ^ "Enabling Alternative Window Systems with a non-Mesa Graphics Driver Implementation". 
  99. ^ "Nouveau Video Acceleration". 
  100. ^ "Radeon Feature Matrix". 
  101. ^ Toral, Iago (8 August 2014). "Diving into Mesa". Retrieved 19 May 2016. 
  102. ^ "Direct Rendering Infrastructure Status Page". 
  103. ^
  104. ^
  105. ^
  106. ^
  107. ^ a b c Paul, Brian (2000-08-10). "Introduction to the Direct Rendering Infrastructure". Retrieved 2012-01-25. 
  108. ^ "DRI2". Retrieved 2012-01-25. 
  109. ^
  110. ^
  111. ^ "xorg-x11-drv-intel-2.99.917-19.20151206.fc23 (re)enabled dri3 by default - kde - Fedora Mailing-Lists". Retrieved 2016-12-03. 
  112. ^ "Radeon-AMDGPU-1.19-Updates". Retrieved 2016-12-03. 
  113. ^ "LLVMpipe: OpenGL With Gallium3D on Your CPU". 2010-04-30. Retrieved 2014-11-04. 
  114. ^ "llvmpipe". Retrieved 2015-06-08. 
  115. ^
  116. ^
  117. ^
  118. ^ "DRI megadrivers". 2013-09-25. 
  119. ^ "VDPAU & XvMC state trackers are now separate libraries". 2014-06-23. 
  120. ^ "Build configuration file". Gallium documentation. 
  121. ^ Fonseca, José (2008-04-27). "Gallium3D: Introduction". Retrieved 2014-06-20. 
  122. ^ Fonseca, José. " Introduction". Retrieved 2016-10-28. 
  123. ^ "Gallium3D Now In Mainline Mesa Code-Base!". Phoronix. 2009-02-11. Retrieved 2010-10-26. 
  124. ^ "The state of Nouveau, part 2". 2008-02-26. Retrieved 2008-03-07. 
  125. ^ a b "Nouveau Companion 36". 2008-03-07. Retrieved 2008-04-01. 
  126. ^ "ATI R300 Gallium3D DRI Support Is "Done"". Phoronix. 2009-11-09. Retrieved 2010-11-15. 
  127. ^ "Radeon "R600g" Gallium3D Driver Merged To [Mesa] Master". Phoronix. 2010-05-27. Retrieved 2010-10-26. 
  128. ^ "X.Org Wiki GalliumStatus". Xorg. 2010-09-22. Retrieved 2010-12-07. 
  129. ^ "TG-Gallium3D". Tungsten Graphics. Retrieved 2008-04-01. 
  130. ^ Rusin, Zack (2008-02-06). "GPGPU". Retrieved 2008-04-01. 
  131. ^ Rusin, Zack (2008-02-07). "OpenVG and accelerating 2D". Retrieved 2008-04-01. 
  132. ^ "DRI2". 2007-10-04. Retrieved 2008-04-01. 
  133. ^ Rusin, Zack (2007-11-02). "Gallium3D LLVM". Retrieved 2008-04-01. 
  134. ^ Marshall, David (2008-12-16). "VMware's year end acquisition of Tungsten Graphics". InfoWorld. 
  135. ^ contributors to - Software/gallium (2011-11-02). "gallium". Retrieved 2012-08-24. 
  136. ^ "Nouveau Companion 37". 2008-03-21. Retrieved 2008-04-01. 
  137. ^ "nouveau: say goodbye to the old DRI driver... (cgit on FDO)". 2008-07-13. 
  138. ^ "Gallium3D Now In Mainline Mesa Code-Base!". 2009-02-11. 
  139. ^ Larabel, Michael (2009-02-25). "Gallium3D, EGL Now Buildable On FreeBSD". Phoronix. 
  140. ^ "OpenVG state tracker is in Mesa 3D". 2009-05-01. 
  141. ^ "Mesa 7.5 Release Notes / 17 July 2009". 2009-07-17. 
  142. ^ "r600g: add initial evergreen support (cgit on FDO)". 2010-09-10. 
  143. ^ "d3d1x: add new Direct3D 10/11 COM state tracker for Gallium". 2010-09-21. 
  144. ^ Larabel, Michael (2011-11-30). "The Gallium3D Intel 965 Driver Gets Dropped". Phoronix. p. 1. Retrieved 2011-12-01. 
  145. ^ Larabel, Michael (2011-11-30). "The Gallium3D Cell Driver Gets Dropped Too". Phoronix. p. 1. Retrieved 2011-12-01. 
  146. ^ "nine: Add state tracker nine for Direct3D9 (v3)". 2014-11-18. 
  147. ^ "What's the relationship between Glide and DRI?". Retrieved 2012-01-25. 

External links

External links for Gallium3D

Various layers within Linux, also showing separation between the userland and kernel space
User mode User applications For example, bash, LibreOffice, GIMP, Blender, 0 A.D., Mozilla Firefox, etc.
Low-level system components: System daemons:
systemd, runit, logind, networkd, PulseAudio, ...
Windowing system:
X11, Wayland, SurfaceFlinger (Android)
Other libraries:
GTK+, Qt, EFL, SDL, SFML, FLTK, GNUstep, etc.
Mesa, AMD Catalyst, ...
C standard library open(), exec(), sbrk(), socket(), fopen(), calloc(), ... (up to 2000 subroutines)
glibc aims to be POSIX/SUS-compatible, uClibc targets embedded systems, bionic written for Android, etc.
Kernel mode Linux kernel stat, splice, dup, read, open, ioctl, write, mmap, close, exit, etc. (about 380 system calls)
The Linux kernel System Call Interface (SCI, aims to be POSIX/SUS-compatible)
Process scheduling
Memory management
Virtual files
Other components: ALSA, DRI, evdev, LVM, device mapper, Linux Network Scheduler, Netfilter
Linux Security Modules: SELinux, TOMOYO, AppArmor, Smack
Hardware (CPU, main memory, data storage devices, etc.)