||It has been suggested that this article be merged into Mesa (computer graphics). (Discuss) Proposed since March 2015.|
|Original author(s)||Tungsten Graphics (now VMware)|
0.4 / April 24, 2010
Gallium3D is a set of interfaces and a collection of supporting libraries 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, and the implementation is available as free and open-source software as part of Mesa 3D hosted by freedesktop.org. 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 and is currently used by the free and open-source graphics driver for Nvidia (nouveau project), for R300–R900, and for other free and open-source GPU device drivers.
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.
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. 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. 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, e.g. TeraScale (microarchitecture), Graphics Core Next, Tesla (microarchitecture), etc.
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.
||This section needs to be updated. (January 2015)|
As of fall 2011, there were at least 10 known, mature and working Gallium3D drivers.[not in citation given] Open-source drivers for Nvidia graphics cards by the name of Nouveau team develops its drivers using the Gallium3D framework.
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 Freedesktop.org.
2009-02-11: The gallium-0.2 branch was merged into mainline Master branch of Mesa. Development is done in Mesa mainline.
2009-02-25: Gallium3D can run on Linux as well as FreeBSD kernels.
2009-07-17: Mesa3D 7.5 is released, the first version to include Gallium3D.
2010-09-10: Initial support for the Evergreen GPUs was added to the r600g driver.
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. In time, this might offer the ability to use recent Direct3D implementations on GNU/Linux systems.
2014-11-18: Major commits were made to the code to support Direct3D 9.
- "Build configuration file". cgit.freedesktop.org. Gallium documentation.
- Fonseca, José (2008-04-27). "Gallium3D: Introduction". Retrieved 2014-06-20.
- Fonseca, José. "MESA3D.org: Introduction". Retrieved 2016-10-28.
- "Gallium3D Now In Mainline Mesa Code-Base!". Phoronix. 2009-02-11. Retrieved 2010-10-26.
- "The state of Nouveau, part 2". LWN.net. 2008-02-26. Retrieved 2008-03-07.
- "Nouveau Companion 36". 2008-03-07. Retrieved 2008-04-01.
- "ATI R300 Gallium3D DRI Support Is "Done"". Phoronix. 2009-11-09. Retrieved 2010-11-15.
- "Radeon "R600g" Gallium3D Driver Merged To [Mesa] Master". Phoronix. 2010-05-27. Retrieved 2010-10-26.
- "X.Org Wiki GalliumStatus". Xorg. 2010-09-22. Retrieved 2010-12-07.
- "TG-Gallium3D". Tungsten Graphics. Retrieved 2008-04-01.
- Rusin, Zack (2008-02-06). "GPGPU". Retrieved 2008-04-01.
- Rusin, Zack (2008-02-07). "OpenVG and accelerating 2D". Retrieved 2008-04-01.
- "DRI2". 2007-10-04. Retrieved 2008-04-01.
- Rusin, Zack (2007-11-02). "Gallium3D LLVM". Retrieved 2008-04-01.
- Marshall, David (2008-12-16). "VMware's year end acquisition of Tungsten Graphics". InfoWorld.
- contributors to freedesktop.org - Software/gallium (2011-11-02). "gallium". freedesktop.org. Retrieved 2012-08-24.
- "Nouveau Companion 37". 2008-03-21. Retrieved 2008-04-01.
- "nouveau: say goodbye to the old DRI driver... (cgit on FDO)". 2008-07-13.
- "Gallium3D Now In Mainline Mesa Code-Base!". 2009-02-11.
- Larabel, Michael (2009-02-25). "Gallium3D, EGL Now Buildable On FreeBSD". Phoronix.
- "OpenVG state tracker is in Mesa 3D". 2009-05-01.
- "Mesa 7.5 Release Notes / 17 July 2009". 2009-07-17.
- "r600g: add initial evergreen support (cgit on FDO)". 2010-09-10.
- "d3d1x: add new Direct3D 10/11 COM state tracker for Gallium". 2010-09-21.
- Larabel, Michael (2011-11-30). "The Gallium3D Intel 965 Driver Gets Dropped". Phoronix. p. 1. Retrieved 2011-12-01.
- Larabel, Michael (2011-11-30). "The Gallium3D Cell Driver Gets Dropped Too". Phoronix. p. 1. Retrieved 2011-12-01.
- "nine: Add state tracker nine for Direct3D9 (v3)". 2014-11-18.
- freedesktop.org - Gallium3D, an article on the current state of Gallium3D
- Fonseca, José (April 2008), Introduction into Gallium3D
- Rusin, Zack, Gallium3D
- Corbet, Jonathan (November 2007), Memory management for graphics processors
- Generic GPU-Accelerated Video Decoding, Google Summer of Code 2008 project using Gallium
- Rusin, Zack (2008), Gallium3D: Graphics Done Right (PDF) (presentation), Akademy
- Rusin, Zack (2008), Gallium3D: Graphics Done Right (video) (presentation), Akademy
- Update on Gallium3D ports to AROS and Haiku (PDF), FOSDEM 2010, 7 February 2010