sourcetree.rst revision 7ec681f3
17ec681f3SmrgSource Code Tree
27ec681f3Smrg================
37ec681f3Smrg
47ec681f3SmrgThis is a brief summary of Mesa's directory tree and what's contained in
57ec681f3Smrgeach directory.
67ec681f3Smrg
77ec681f3Smrg-  **docs** - Documentation
87ec681f3Smrg-  **include** - Public OpenGL header files
97ec681f3Smrg-  **src**
107ec681f3Smrg
117ec681f3Smrg   -  **amd** - AMD-specific sources
127ec681f3Smrg
137ec681f3Smrg      -  **addrlib** - common sources for creating images
147ec681f3Smrg      -  **common** - common code between RADV, radeonsi and ACO
157ec681f3Smrg      -  **compiler** - ACO shader compiler
167ec681f3Smrg      -  **llvm** - common code between RADV and radeonsi for compiling
177ec681f3Smrg         shaders using LLVM
187ec681f3Smrg      -  **registers** - register definitions
197ec681f3Smrg      -  **vulkan** - RADV Vulkan implementation for AMD Southern Island
207ec681f3Smrg         and newer
217ec681f3Smrg
227ec681f3Smrg   -  **compiler** - Common utility sources for different compilers.
237ec681f3Smrg
247ec681f3Smrg      -  **glsl** - the GLSL IR and compiler
257ec681f3Smrg      -  **nir** - the NIR IR and compiler
267ec681f3Smrg      -  **spirv** - the SPIR-V compiler
277ec681f3Smrg
287ec681f3Smrg   -  **egl** - EGL library sources
297ec681f3Smrg
307ec681f3Smrg      -  **drivers** - EGL drivers
317ec681f3Smrg      -  **main** - main EGL library implementation. This is where all
327ec681f3Smrg         the EGL API functions are implemented, like eglCreateContext().
337ec681f3Smrg
347ec681f3Smrg   -  **freedreno** - Adreno-specific sources
357ec681f3Smrg
367ec681f3Smrg      -  **fdl** - mipmap layout manager
377ec681f3Smrg      -  **vulkan** - Turnip is a Vulkan implementation for
387ec681f3Smrg         Qualcomm Adreno
397ec681f3Smrg
407ec681f3Smrg   -  **gbm** - Generic Buffer Manager is a memory allocator for
417ec681f3Smrg      device buffers
427ec681f3Smrg
437ec681f3Smrg   -  **intel** - Intel-specific sources
447ec681f3Smrg
457ec681f3Smrg      -  **blorp** - BLit Or Resolve Pass is a blit and HiZ resolve framework
467ec681f3Smrg      -  **vulkan** - Anvil is a Vulkan implementation for Intel gen 7
477ec681f3Smrg         (Ivy Bridge) and newer
487ec681f3Smrg
497ec681f3Smrg   -  **mapi** - Mesa APIs
507ec681f3Smrg
517ec681f3Smrg      -  **glapi** - OpenGL API dispatch layer. This is where all the GL
527ec681f3Smrg         entrypoints like glClear, glBegin, etc. are generated, as well as
537ec681f3Smrg         the GL dispatch table. All GL function calls jump through the
547ec681f3Smrg         dispatch table to functions found in main/.
557ec681f3Smrg
567ec681f3Smrg   -  **mesa** - Main Mesa sources
577ec681f3Smrg
587ec681f3Smrg      -  **main** - The core Mesa code (mainly state management)
597ec681f3Smrg      -  **drivers** - Mesa drivers (not used with Gallium)
607ec681f3Smrg
617ec681f3Smrg         -  **common** - code which may be shared by all drivers
627ec681f3Smrg         -  **dri** - Direct Rendering Infrastructure drivers
637ec681f3Smrg
647ec681f3Smrg            -  **common** - code shared by all DRI drivers
657ec681f3Smrg            -  **i915** - driver for Intel i915/i945
667ec681f3Smrg            -  **i965** - driver for Intel i965
677ec681f3Smrg            -  **nouveau** - driver for nVidia nv04/nv10/nv20
687ec681f3Smrg            -  **radeon** - driver for ATI R100
697ec681f3Smrg            -  **r200** - driver for ATI R200
707ec681f3Smrg            -  **swrast** - software rasterizer driver that uses the
717ec681f3Smrg               swrast module
727ec681f3Smrg
737ec681f3Smrg         -  **x11** - Xlib-based software driver
747ec681f3Smrg         -  **osmesa** - off-screen software driver
757ec681f3Smrg
767ec681f3Smrg      -  **math** - vertex array translation and transformation code
777ec681f3Smrg         (not used with Gallium)
787ec681f3Smrg      -  **program** - Vertex/fragment shader and GLSL compiler code
797ec681f3Smrg      -  **sparc** - Assembly code/optimizations for SPARC systems (not
807ec681f3Smrg         used with Gallium)
817ec681f3Smrg      -  **state_tracker** - Translator from Mesa to Gallium. This is
827ec681f3Smrg         basically a Mesa device driver that speaks to Gallium. This
837ec681f3Smrg         directory may be moved to src/mesa/drivers/gallium at some
847ec681f3Smrg         point.
857ec681f3Smrg      -  **swrast** - Software rasterization module. For drawing points,
867ec681f3Smrg         lines, triangles, bitmaps, images, etc. in software. (not used
877ec681f3Smrg         with Gallium)
887ec681f3Smrg      -  **swrast_setup** - Software primitive setup. Does things like
897ec681f3Smrg         polygon culling, glPolygonMode, polygon offset, etc. (not used
907ec681f3Smrg         with Gallium)
917ec681f3Smrg      -  **tnl** - Software vertex Transformation 'n Lighting. (not used
927ec681f3Smrg         with Gallium)
937ec681f3Smrg      -  **tnl_dd** - TNL code for device drivers. (not used with
947ec681f3Smrg         Gallium)
957ec681f3Smrg      -  **vbo** - Vertex Buffer Object code. All drawing with
967ec681f3Smrg         glBegin/glEnd, glDrawArrays, display lists, etc. goes through
977ec681f3Smrg         this module. The results is a well-defined set of vertex arrays
987ec681f3Smrg         which are passed to the device driver (or tnl module) for
997ec681f3Smrg         rendering.
1007ec681f3Smrg      -  **x86** - Assembly code/optimizations for 32-bit x86 systems
1017ec681f3Smrg         (not used with Gallium)
1027ec681f3Smrg      -  **x86-64** - Assembly code/optimizations for 64-bit x86 systems
1037ec681f3Smrg         (not used with Gallium)
1047ec681f3Smrg
1057ec681f3Smrg   -  **gallium** - Gallium3D source code
1067ec681f3Smrg
1077ec681f3Smrg      -  **include** - Gallium3D header files which define the Gallium3D
1087ec681f3Smrg         interfaces
1097ec681f3Smrg      -  **drivers** - Gallium3D device drivers
1107ec681f3Smrg
1117ec681f3Smrg         -  **etnaviv** - Driver for Vivante.
1127ec681f3Smrg         -  **freedreno** - Driver for Qualcomm Adreno.
1137ec681f3Smrg         -  **i915** - Driver for Intel i915/i945.
1147ec681f3Smrg         -  **iris** - Driver for Intel gen 8 (Broadwell) and newer.
1157ec681f3Smrg         -  **lima** - Driver for ARM Mali-400 (Utgard) series.
1167ec681f3Smrg         -  **llvmpipe** - Software driver using LLVM for runtime code
1177ec681f3Smrg            generation.
1187ec681f3Smrg         -  **nouveau** - Driver for NVIDIA GPUs.
1197ec681f3Smrg         -  **panfrost** - Driver for ARM Mali Txxx (Midgard) and
1207ec681f3Smrg            Gxx (Bifrost) GPUs.
1217ec681f3Smrg         -  **radeon** - Shared module for the r600 and radeonsi
1227ec681f3Smrg            drivers.
1237ec681f3Smrg         -  **r300** - Driver for ATI R300 - R500.
1247ec681f3Smrg         -  **r600** - Driver for ATI/AMD R600 - Northern Island (Terascale).
1257ec681f3Smrg         -  **radeonsi** - Driver for AMD Southern Island and newer (GCN, RDNA).
1267ec681f3Smrg         -  **softpipe** - Software reference driver.
1277ec681f3Smrg         -  **svga** - Driver for VMware's SVGA virtual GPU.
1287ec681f3Smrg         -  **swr** - Software driver with massively parellel vertex processing.
1297ec681f3Smrg         -  **tegra** - Driver for NVIDIA Tegra GPUs.
1307ec681f3Smrg         -  **v3d** - Driver for Broadcom VideoCore 5 and newer.
1317ec681f3Smrg         -  **vc4** - Driver for Broadcom VideoCore 4.
1327ec681f3Smrg         -  **virgl** - Driver for Virtio virtual GPU of QEMU.
1337ec681f3Smrg         -  **zink** - Driver that uses Vulkan for rendering.
1347ec681f3Smrg
1357ec681f3Smrg      -  **auxiliary** - Gallium support code
1367ec681f3Smrg
1377ec681f3Smrg         -  **cso_cache** - Constant State Objects Cache. Used to filter
1387ec681f3Smrg            out redundant state changes between frontends and drivers.
1397ec681f3Smrg         -  **draw** - Software vertex processing and primitive assembly
1407ec681f3Smrg            module. This includes vertex program execution, clipping,
1417ec681f3Smrg            culling and optional stages for drawing wide lines, stippled
1427ec681f3Smrg            lines, polygon stippling, two-sided lighting, etc. Intended
1437ec681f3Smrg            for use by drivers for hardware that does not have vertex
1447ec681f3Smrg            shaders. Geometry shaders will also be implemented in this
1457ec681f3Smrg            module.
1467ec681f3Smrg         -  **gallivm** - LLVM module for Gallium. For LLVM-based
1477ec681f3Smrg            compilation, optimization and code generation for TGSI
1487ec681f3Smrg            shaders. Incomplete.
1497ec681f3Smrg         -  **hud** - Heads-Up Display, an overlay showing GPU statistics
1507ec681f3Smrg         -  **pipebuffer** - utility module for managing buffers
1517ec681f3Smrg         -  **rbug** - Gallium remote debug utility
1527ec681f3Smrg         -  **rtasm** - run-time assembly/machine code generation.
1537ec681f3Smrg            Currently there's run-time code generation for x86/SSE,
1547ec681f3Smrg            PowerPC and Cell SPU.
1557ec681f3Smrg         -  **tessellator**- used by software drivers to implement
1567ec681f3Smrg            tessellation shaders
1577ec681f3Smrg         -  **tgsi** - TG Shader Infrastructure. Code for encoding,
1587ec681f3Smrg            manipulating and interpreting GPU programs.
1597ec681f3Smrg         -  **translate** - module for translating vertex data from one
1607ec681f3Smrg            format to another.
1617ec681f3Smrg         -  **util** - assorted utilities for arithmetic, hashing,
1627ec681f3Smrg            surface creation, memory management, 2D blitting, simple
1637ec681f3Smrg            rendering, etc.
1647ec681f3Smrg         -  **vl** - utility code for video decode/encode
1657ec681f3Smrg         -  XXX more
1667ec681f3Smrg
1677ec681f3Smrg      -  **frontends** - These implement various libraries using the
1687ec681f3Smrg         device drivers
1697ec681f3Smrg
1707ec681f3Smrg         -  **clover** - OpenCL frontend
1717ec681f3Smrg         -  **dri** - Meta frontend for DRI drivers, see mesa/state_tracker
1727ec681f3Smrg         -  **glx** - Meta frontend for GLX
1737ec681f3Smrg         -  **hgl** - Haiku OpenGL
1747ec681f3Smrg         -  **nine** - D3D9 frontend, see targets/d3dadapter9
1757ec681f3Smrg         -  **omx** - OpenMAX Bellagio frontend
1767ec681f3Smrg         -  **osmesa** - Off-screen OpenGL rendering library
1777ec681f3Smrg         -  **va** - VA-API frontend
1787ec681f3Smrg         -  **vdpau** - VDPAU frontend
1797ec681f3Smrg         -  **wgl** - Windows WGL frontend
1807ec681f3Smrg         -  **xa** - XA frontend
1817ec681f3Smrg         -  **xvmc** - XvMC frontend
1827ec681f3Smrg
1837ec681f3Smrg      -  **winsys** - The device drivers are platform-independent, the
1847ec681f3Smrg         winsys connects them to various platforms. There is usually one winsys
1857ec681f3Smrg         per device family, and within the winsys directory there can be
1867ec681f3Smrg         multiple flavors connecting to different platforms.
1877ec681f3Smrg
1887ec681f3Smrg         -  **drm** - Direct Rendering Manager on Linux
1897ec681f3Smrg         -  **gdi** - Windows
1907ec681f3Smrg         -  **xlib** - indirect rendering on X Window System
1917ec681f3Smrg         -  XXX more
1927ec681f3Smrg
1937ec681f3Smrg   -  **targets** - These control how the Gallium code is compiled into
1947ec681f3Smrg      different libraries. Each of these roughly corresponds to one frontend.
1957ec681f3Smrg
1967ec681f3Smrg         -  **d3dadapter9** - d3dadapter9.so for Wine
1977ec681f3Smrg         -  **dri** - libgallium_dri.so loaded by libGL.so
1987ec681f3Smrg         -  **graw** - raw Gallium interface without a frontend
1997ec681f3Smrg         -  XXX more
2007ec681f3Smrg
2017ec681f3Smrg   -  **glx** - The GLX library code for building libGL.so using DRI
2027ec681f3Smrg      drivers.
2037ec681f3Smrg   -  **loader** - Used by libGL.so to find and load the appropriate DRI driver.
2047ec681f3Smrg   -  **panfrost** - Panfrost-specific sources
2057ec681f3Smrg
2067ec681f3Smrg         -  **bifrost** - shader compiler for the Bifrost generation GPUs
2077ec681f3Smrg         -  **lib** - GPU data structures (command stream) support code`
2087ec681f3Smrg         -  **midgard** - shader compiler for the Midgard generation GPUs
2097ec681f3Smrg         -  **shared** - shared Mali code between Lima and Panfrost
2107ec681f3Smrg         -  **util** - shared code between Midgard and Bifrost shader compilers
2117ec681f3Smrg
2127ec681f3Smrg   -  **util** - Various utility codes
2137ec681f3Smrg   -  **vulkan** - Common code for Vulkan drivers
214