Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Mesa (computer graphics)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 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 [[Application programming interface|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 (operating system)|kernel]] of the [[operating system]] and each one implements the Gallium3D WinSys Interface to interface with all available Gallium3D hardware device drivers. [[File:Mesa layers of crap 2016.svg|thumb|VC4 and freedreno can both consume NIR directly (and fall back to tgsi_to_nir for shaders that do not use glsl_to_nir).]] [[File:Linux Graphics Stack 2013.svg|thumb|Illustration of the [[Linux]] graphics stack]] [[File:Gallium3D vs DRI graphics driver model.svg|thumb|Mesa/[[Direct Rendering Infrastructure|DRI]] and Gallium3D have different driver models. Both share a lot of [[free and open-source]] code.]] [[File:Gallium3D example matrix.svg|thumb|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 (software)|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.<ref>{{cite web |url = http://www.tungstengraphics.com/technologies/gallium3d.html |archive-url = https://web.archive.org/web/20080503021058/http://www.tungstengraphics.com/technologies/gallium3d.html |url-status = dead |archive-date = 3 May 2008 |title = TG-Gallium3D |publisher = Tungsten Graphics |access-date = 1 April 2008 }}</ref><ref>{{cite web |url = http://zrusin.blogspot.com/2008/02/gpgpu.html |title = GPGPU |last = Rusin |first = Zack |date = 6 February 2008 |access-date = 1 April 2008 }}</ref><ref>{{cite web |url = http://zrusin.blogspot.com/2008/02/openvg-and-accelerating-2d.html |title = OpenVG and accelerating 2D |last = Rusin |first = Zack |date = 7 February 2008 |access-date = 1 April 2008 }}</ref> 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 Infrastructure|Direct Rendering Interface]] (DRI2) drivers will be more GPU processing oriented.<ref>{{cite web |url = http://wiki.x.org/wiki/DRI2 |title = DRI2 |date = 4 October 2007 |access-date = 1 April 2008 |url-status = dead |archive-url = https://web.archive.org/web/20080704122122/http://wiki.x.org/wiki/DRI2 |archive-date = 4 July 2008 |df = dmy-all }}</ref> 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. NIR is the new Layer representation in Mesa with full SPIR-V support and since 2019 main development area of all newer drivers with OpenGL 4.6 support. ==== LLVM usage ==== [[File:GlassyMesa3D.svg|thumb|GlassyMesa is an LLVM-based compiler stack for shaders written in [[OpenGL Shading Language|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.<ref>{{cite web |url = http://zrusin.blogspot.com/2007/11/gallium3d-llvm.html |title = Gallium3D LLVM |last = Rusin |first = Zack |date = 2 November 2007 |access-date = 1 April 2008 }}</ref> 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)