Gallium3D

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

Gallium3D
Original author(s) Tungsten Graphics (now VMware)
Preview release 0.4[1] / April 24, 2010; 13 years ago (2010-04-24)
Written in C
Operating system Cross-platform
Type Graphics library
License MIT License
Website www.freedesktop.org/wiki/Software/gallium/

Gallium3D is a set of interfaces and a collection of supporting libraries[2] intended to ease the programming of device drivers for 3D graphics chipsets for multiple operating systems, rendering or video acceleration APIs 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 – 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.

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

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[3] and is currently used by the free and open source graphics driver for Nvidia (nouveau project),[4][5] for R300R900,[6][7][8] and for other free and open-source GPU device drivers.

Software architecture

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.[9][10][11] 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.[12] 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.

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.[13]

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

Adoption

Several free and open-source graphics device drivers which have been respectively 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 Graphics hardware and FOSS for a complete list). The main reason may be, that the Gallium3D driver model lessens the amount of code required to be written. 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.

History

Original authors of Gallium3D were Keith Whitwell and Brian Paul at Tungsten Graphics (acquired by VMware).

Milestones

Lua error in package.lua at line 80: module 'strict' not found. As of Fall 2011, there were at least 10 known, mature and working Gallium3D drivers.[14][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.[5][15]

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.[16]

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

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

2009-05-01: Zack Rusin from Tungsten Graphics added the OpenVG state tracker to Mesa 3D,[19] 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.[20]

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

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.[22] 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.[23][24]

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

See also

References

  1. cgit.freedesktop.org Build configuration file – Gallium documentation
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. 5.0 5.1 Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.
  17. Lua error in package.lua at line 80: module 'strict' not found.
  18. Lua error in package.lua at line 80: module 'strict' not found.
  19. Lua error in package.lua at line 80: module 'strict' not found.
  20. Lua error in package.lua at line 80: module 'strict' not found.
  21. Lua error in package.lua at line 80: module 'strict' not found.
  22. Lua error in package.lua at line 80: module 'strict' not found.
  23. Lua error in package.lua at line 80: module 'strict' not found.
  24. Lua error in package.lua at line 80: module 'strict' not found.
  25. Lua error in package.lua at line 80: module 'strict' not found.

External links