Mesa简介

Mesa, also called Mesa3D and  The Mesa 3D Graphics Library, is an  open source software implementation of  OpenGL, Vulkan, and other  graphics  API specifications. Mesa translates these specifications to vendor-specific graphics hardware drivers.

Mesa 实际上是一个库,它实现了多种图形 API 规范,这其中就包括了最著名的 OpenGL。Mesa 底层直接使用图形硬件驱动。

Mesa implements a translation layer between a graphics API such as OpenGL and the graphics hardware drivers in the operating system kernel.

上面这句话基本上点到了 Mesa 的实质。Mesa 实际上就是一个转换层,它提供了图形 API(比如:OpenGL)到图形硬件(比如:显卡 GPU)驱动之间的一个转换。

它诞生之时,是在 CPU 上进行所有渲染的,后续又发展为通过 display server 非直接的渲染。但其内部架构在设计上支持使用显卡硬件 3D 渲染的。

可以说,在适配 DRI 架构时,正式奠定了 Mesa 的位置:

With adapting to DRI, the Mesa library finally took over the role of the front end component of a full scale OpenGL framework with varying backend components that could offer different degrees of 3D hardware support while not dropping the full software rendering capability.

Gallium3D 是 Mesa3D 的一部分,个人理解它的角色就是将 API 转换成特定硬件所能理解的指令。除此之外,还包括 GLSL 到 GPU 指令的转换,状态管理等等。

  • Gallium3D State Tracker: OpenGL 的实现,状态机等等。
  • Gallium3D hardware device driver:实现了特定 GPU 硬件指令代码的转换
  • Gallium3D WinSys:Gallium3D hardware device driver 与操作系统内核的交互

从前,每个图形硬件厂商都需要有自己的 OpenGL/Direct3D 的实现,现在被 Gallium3D State Tracker 取代了,在此层面,不同的图形硬件和操作系统 kernel 是透明的。

在Gallium3D hardware device driver 则需要完成针对于特定 Graph 设备的指令转换,因此,需要和硬件设备强相关。但是,在与 kernel 层交互的时候,不需要知道操作系统的 kernel 是什么。

因为,Gallium3D WinSys 屏蔽了操作系统 kernel 的差异。

关于 Mesa 和 Gallium3D 在系统层面的位置和作用,看维基百科的图像会更加清晰直观:

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。

参考链接:

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值