Mesa代码结构分析

本文介绍了Mesa20.0.8源码树,为简化移除了tests相关内容。分析方法采用ninja -t browse让ninja工具自动生成构建依赖关系图,可在浏览器查看。还对gallium/drivers/vc4下多个文件及OSMesa相关文件进行了分析。


官方源码树介绍

Source Code Tree

Mesa20.0.8源码树

为了简化,移除了tests相关的内容

├── bin # 一些python和shell脚本类工具
│   └── pick # git cherry-pick相关的python脚本
├── build-support
├── docs # 文档
│   ├── relnotes # release notes
│   └── specs # Mesa相关的OpenGL扩展规范
│       └── OLD
├── doxygen
├── include # 公用的OpenGL头文件
│   ├── c11
│   ├── CL
│   ├── D3D9
│   ├── d3dadapter
│   ├── drm-uapi
│   ├── EGL
│   ├── GL
│   │   └── internal
│   ├── GLES
│   ├── GLES2
│   ├── GLES3
│   ├── HaikuGL
│   ├── KHR
│   ├── pci_ids
│   └── vulkan
├── src
│   ├── amd # AMD相关的源代码
│   │   ├── addrlib # common sources for creating images, (calculate texture addresses ??)
│   │   │   ├── inc
│   │   │   └── src
│   │   │       ├── chip
│   │   │       │   ├── gfx10
│   │   │       │   ├── gfx9
│   │   │       │   └── r800
│   │   │       ├── core
│   │   │       ├── gfx10
│   │   │       ├── gfx9
│   │   │       └── r800
│   │   ├── common # common code between RADV, randeonsi and ACO
│   │   ├── compiler # ACO shader compiler
│   │   ├── llvm # common code between RADV and radeonsi for compiling shaders using LLVM
│   │   ├── registers # register definitions
│   │   └── vulkan # RADV Vulkan implementation for AMD Southern Island and newer
│   │       └── winsys
│   │           ├── amdgpu
│   │           └── null
│   ├── broadcom
│   │   ├── cle
│   │   ├── clif
│   │   ├── common
│   │   ├── compiler
│   │   ├── drm-shim
│   │   └── qpu
│   ├── compiler # Common utility sources for different compilers
│   │   ├── glsl # the GLSL IR and compiler
│   │   │   └── glcpp
│   │   ├── nir # the NIR IR and compiler
│   │   └── spirv # the SPIR-V compiler
│   ├── drm-shim
│   ├── egl # EGL library sources
│   │   ├── drivers # EGL drivers
│   │   │   ├── dri2
│   │   │   └── haiku
│   │   ├── generate
│   │   ├── main # main EGL library implementation. This is where all the EGL API functions are implemented, like eglCreateContext().
│   │   └── wayland
│   │       └── wayland-drm
│   ├── etnaviv
│   │   ├── drm
│   │   └── drm-shim
│   ├── freedreno # Qualcomm Adreno-specific sources(高通)
│   │   ├── drm
│   │   ├── drm-shim
│   │   ├── fdl # mipmap layout manager
│   │   ├── ir3
│   │   ├── perfcntrs
│   │   ├── registers
│   │   └── vulkan # Turnip is a Vulkan implementation for Qualcomm Adreno
│   ├── gallium # Galllium3D source code
│   │   ├── auxiliary # Gallium suport code
│   │   │   ├── cso_cache # Constant State Objects Cache. Used to filter out redundant state
│   │   │   │             # changes between frontends and drivers.
│   │   │   ├── draw # Software vertex processing and primitive assembly module.
│   │   │   │        # This include vertex program execution, clipping, culling and optional
│   │   │   │        # stages for drawing wide lines, stippled lines, polygon stippling, two-sided
│   │   │   │        # lighting, etc. Intended for use by drivers for hardware that does not have
│   │   │   │        # vertex shaders. Geometry shaders will also be implemented in this module. 
│   │   │   │ 
│   │   │   ├── driver_ddebug
│   │   │   ├── driver_noop
│   │   │   ├── driver_rbug # Gallium remote debug utility ???
│   │   │   ├── driver_trace
│   │   │   ├── gallivm # LLVM module for Gallium. For LLVM-based compilation, optimization and 
│   │   │   │           # code generation for TGSI shaders. Incomplete.??
│   │   │   │           
│   │   │   ├── hud # Heads-Up Display, an overlay showing GPU statistics
│   │   │   ├── indices
│   │   │   ├── nir
│   │   │   ├── os
│   │   │   ├── pipebuffer # utility module for managing buffers
│   │   │   ├── pipe-loader
│   │   │   ├── postprocess
│   │   │   ├── rbug
│   │   │   ├── renderonly
│   │   │   ├── rtasm # run-time assembly/machine code generation. Currently there's run-time code
│   │   │   │         # generation for x86/SSE, PowerPC and Cell SPU.
│   │   │   ├── target-helpers
│   │   │   ├── tgsi # TG Shader Infrastructure. Code for encoding, manipulating and 
│   │   │   │        # interpreting GPU programs.
│   │   │   ├── translate # module for translating vertex data from one format to another
│   │   │   ├── util # assorted utilities for arithmetic, hashing, surface creation, 
│   │   │   │        # memory management, 2D blitting, simple rendering, etc.
│   │   │   └── vl # utility code for video decode/encode
│   │   ├── docs # 里面有个pipeline.txt需要仔细读一下
│   │   │   └── source
│   │   │       ├── cso
│   │   │       ├── drivers
│   │   │       │   ├── freedreno
│   │   │       │   └── openswr
│   │   │       └── exts
│   │   ├── drivers # Gallium3D device drivers
│   │   │   ├── etnaviv # Driver for Vivante.
│   │   │   │   └── hw
│   │   │   ├── freedreno # Driver for Qualcomm Adreno
│   │   │   │   ├── a2xx
│   │   │   │   ├── a3xx
│   │   │   │   ├── a4xx
│   │   │   │   ├── a5xx
│   │   │   │   ├── a6xx
│   │   │   │   └── ir3
│   │   │   ├── i915 # Driver for Intel i915/i945.
│   │   │   ├── iris # Driver for Intel gen 8 (Broadwell) and newer.
│   │   │   ├── kmsro #
│   │   │   ├── lima # Driver for ARM Mali-400 (Utgard) series.
│   │   │   │   ├── ir
│   │   │   │   │   ├── gp
│   │   │   │   │   └── pp
│   │   │   │   └── standalone
│   │   │   ├── llvmpipe # Software driver using LLVM for runtime code generation.
│   │   │   ├── nouveau # Driver for NVIDIA GPUs.
│   │   │   │   ├── codegen
│   │   │   │   │   └── lib
│   │   │   │   ├── nv30
│   │   │   │   ├── nv50
│   │   │   │   └── nvc0
│   │   │   │       └── mme
│   │   │   ├── panfrost # Driver for ARM Mali Txxx (Midgard) and Gxx (Bifrost) GPUs.
│   │   │   │   └── nir
│   │   │   ├── r300 # Driver for ATI R300 - R500.
│   │   │   │   └── compiler
│   │   │   ├── r600 # Driver for ATI/AMD R600 - Northern Island (Terascale).
│   │   │   │   └── sb
│   │   │   ├── radeon # Shared module for the r600 and radeonsi drivers.
│   │   │   ├── radeonsi # Driver for AMD Southern Island and newer (GCN, RDNA).
│   │   │   ├── softpipe # Software reference driver.
│   │   │   ├── svga #  Driver for VMware’s SVGA virtual GPU.
│   │   │   │   ├── include
│   │   │   │   └── svgadump
│   │   │   ├── swr # Software driver with massively parellel vertex processing.
│   │   │   │   └── rasterizer
│   │   │   │       ├── archrast
│   │   │   │       ├── codegen
│   │   │   │       │   └── templates
│   │   │   │       ├── common
│   │   │   │       ├── core
│   │   │   │       │   └── backends
│   │   │   │       ├── jitter
│   │   │   │       │   ├── functionpasses
│   
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值