xref: /aosp_15_r20/external/mesa3d/docs/sourcetree.rst (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1Source Code Tree
2================
3
4This is a brief summary of Mesa's directory tree and what's contained in
5each directory.
6
7-  **docs** - Documentation
8-  **include** - Public OpenGL header files
9-  **src**
10
11   -  **amd** - AMD-specific sources
12
13      -  **addrlib** - common sources for creating images
14      -  **common** - common code between RADV, RadeonSI and ACO
15      -  **compiler** - ACO shader compiler
16      -  **llvm** - common code between RADV and RadeonSI for compiling
17         shaders using LLVM
18      -  **registers** - register definitions
19      -  **vulkan** - RADV Vulkan implementation for AMD Southern Island
20         and newer
21
22   -  **compiler** - Common utility sources for different compilers.
23
24      -  **glsl** - the GLSL IR and compiler
25      -  **nir** - the NIR IR and compiler
26      -  **spirv** - the SPIR-V compiler
27
28   -  **egl** - EGL library sources
29
30      -  **drivers** - EGL drivers
31      -  **main** - main EGL library implementation. This is where all
32         the EGL API functions are implemented, like eglCreateContext().
33
34   -  **freedreno** - Adreno-specific sources
35
36      -  **fdl** - mipmap layout manager
37      -  **vulkan** - Turnip is a Vulkan implementation for
38         Qualcomm Adreno
39
40   -  **gbm** - Generic Buffer Manager is a memory allocator for
41      device buffers
42
43   -  **intel** - Intel-specific sources
44
45      -  **blorp** - BLit Or Resolve Pass is a blit and HiZ resolve framework
46      -  **vulkan** - Anvil is a Vulkan implementation for Intel gen 7
47         (Ivy Bridge) and newer
48
49   -  **mapi** - Mesa APIs
50
51      -  **glapi** - OpenGL API dispatch layer. This is where all the GL
52         entrypoints like glClear, glBegin, etc. are generated, as well as
53         the GL dispatch table. All GL function calls jump through the
54         dispatch table to functions found in main/.
55
56   -  **mesa** - Main Mesa sources
57
58      -  **main** - The core Mesa code (mainly state management)
59      -  **math** - vertex array translation and transformation code
60         (not used with Gallium)
61      -  **program** - Vertex/fragment shader and GLSL compiler code
62      -  **state_tracker** - Translator from Mesa to Gallium. This is
63         basically a Mesa device driver that speaks to Gallium.
64      -  **vbo** - Vertex Buffer Object code. All drawing with
65         glBegin/glEnd, glDrawArrays, display lists, etc. goes through
66         this module. The results is a well-defined set of vertex arrays
67         which are passed to the device driver (or transform and lighting
68         module) for rendering.
69      -  **x86** - Assembly code/optimizations for 32-bit x86 systems
70         (not used with Gallium)
71      -  **x86-64** - Assembly code/optimizations for 64-bit x86 systems
72         (not used with Gallium)
73
74   -  **gallium** - Gallium3D source code
75
76      -  **include** - Gallium3D header files which define the Gallium3D
77         interfaces
78      -  **drivers** - Gallium3D device drivers
79
80         -  **etnaviv** - Driver for Vivante.
81         -  **freedreno** - Driver for Qualcomm Adreno.
82         -  **i915** - Driver for Intel i915/i945.
83         -  **iris** - Driver for Intel gen 8 (Broadwell) and newer.
84         -  **lima** - Driver for ARM Mali-400 (Utgard) series.
85         -  **llvmpipe** - Software driver using LLVM for runtime code
86            generation.
87         -  **nouveau** - Driver for NVIDIA GPUs.
88         -  **panfrost** - Driver for ARM Mali Txxx (Midgard) and
89            Gxx (Bifrost) GPUs.
90         -  **r300** - Driver for ATI R300 - R500.
91         -  **r600** - Driver for ATI/AMD R600 - Northern Island (Terascale).
92         -  **radeonsi** - Driver for AMD Southern Island and newer (GCN, RDNA).
93         -  **softpipe** - Software reference driver.
94         -  **svga** - Driver for VMware's SVGA virtual GPU.
95         -  **tegra** - Driver for NVIDIA Tegra GPUs.
96         -  **v3d** - Driver for Broadcom VideoCore 5 and newer.
97         -  **vc4** - Driver for Broadcom VideoCore 4.
98         -  **virgl** - Driver for Virtio virtual GPU of QEMU.
99         -  **zink** - Driver that uses Vulkan for rendering.
100
101      -  **auxiliary** - Gallium support code
102
103         -  **cso_cache** - Constant State Objects Cache. Used to filter
104            out redundant state changes between frontends and drivers.
105         -  **draw** - Software vertex processing and primitive assembly
106            module. This includes vertex program execution, clipping,
107            culling and optional stages for drawing wide lines, stippled
108            lines, polygon stippling, two-sided lighting, etc. Intended
109            for use by drivers for hardware that does not have vertex
110            shaders. Geometry shaders will also be implemented in this
111            module.
112         -  **gallivm** - LLVM module for Gallium. For LLVM-based
113            compilation, optimization and code generation for TGSI
114            shaders. Incomplete.
115         -  **hud** - Heads-Up Display, an overlay showing GPU statistics
116         -  **pipebuffer** - utility module for managing buffers
117         -  **rtasm** - run-time assembly/machine code generation.
118            Currently there's run-time code generation for x86/SSE,
119            PowerPC and Cell SPU.
120         -  **tessellator**- used by software drivers to implement
121            tessellation shaders
122         -  **tgsi** - TG Shader Infrastructure. Code for encoding,
123            manipulating and interpreting GPU programs.
124         -  **translate** - module for translating vertex data from one
125            format to another.
126         -  **util** - assorted utilities for arithmetic, hashing,
127            surface creation, memory management, 2D blitting, simple
128            rendering, etc.
129         -  **vl** - utility code for video decode/encode
130         -  XXX more
131
132      -  **frontends** - These implement various libraries using the
133         device drivers
134
135         -  **clover** - OpenCL frontend
136         -  **d3d10umd** - D3D10 frontend for Windows only. It's similar to Microsoft WARP, but using LLVMpipe/Softpipe.
137         -  **dri** - Meta frontend for DRI drivers, see mesa/state_tracker
138         -  **glx** - Meta frontend for GLX
139         -  **hgl** - Haiku OpenGL
140         -  **lavapipe** - Vulkan frontend, software Vulkan rasterizer using LLVMpipe.
141         -  **nine** - D3D9 frontend, see targets/d3dadapter9
142         -  **osmesa** - Off-screen OpenGL rendering library
143         -  **va** - VA-API frontend
144         -  **vdpau** - VDPAU frontend
145         -  **wgl** - Windows WGL frontend
146         -  **xa** - XA frontend
147
148      -  **winsys** - The device drivers are platform-independent, the
149         winsys connects them to various platforms. There is usually one winsys
150         per device family, and within the winsys directory there can be
151         multiple flavors connecting to different platforms.
152
153         -  **drm** - Direct Rendering Manager on Linux
154         -  **gdi** - Windows
155         -  **xlib** - indirect rendering on X Window System
156         -  XXX more
157
158   -  **targets** - These control how the Gallium code is compiled into
159      different libraries. Each of these roughly corresponds to one frontend.
160
161      -  **d3dadapter9** - d3dadapter9.so for Wine
162      -  **dri** - libgallium_dri.so loaded by libGL.so
163      -  XXX more
164
165   -  **glx** - The GLX library code for building libGL.so using DRI
166      drivers.
167   -  **loader** - Used by libGL.so to find and load the appropriate DRI driver.
168   -  **panfrost** - Panfrost-specific sources
169
170      -  **compiler** - shader compiler for Bifrost and newer GPUs
171      -  **lib** - GPU data structures (command stream) support code
172      -  **midgard** - shader compiler for the Midgard generation GPUs
173      -  **shared** - shared Mali code between Lima and Panfrost
174      -  **util** - shared code between Midgard and Bifrost shader compilers
175
176   -  **util** - Various utility codes
177   -  **vulkan** - Common code for Vulkan drivers
178