OpenGL与XServer系列:EGL/GLX/Xegl/XGL/XGLX

来源:互联网 发布:怎么给淘宝差评 编辑:程序博客网 时间:2024/05/05 04:45

Linux的图形系统真是复杂到深不可测,我很怀疑是否大学可以开个课程,用一个学期来讲清楚。例如,最近看资料看到的EGL/GLX/Xegl/XGL/XGLX,感觉是字母G、E、L、X几个字母在排列组合,绕着绕着有些发晕。

 

从EGL说起,EGL是什么呢?en.wikipedia.org上说:

EGL (Embedded-System Graphics Library) "
is an interface betweenKhronos rendering APIs such as OpenGL ES or OpenVG and the underlyingnative platform window system. It handles graphics context management,surface/buffer binding, and rendering synchronization and enableshigh-performance, accelerated, mixed-mode 2D and 3D rendering usingother Khronos APIs.


www.freedesktop.org上说:

EGL is an extension to OpenGLthat was originally designed for embedded system use. EGL replacesGLX/AGL/WGL with a platform independent implementation. Don't confusethe EGL specification with Xegl which is the Linux implementation ofthe EGL specification. EGL is platform independent, Xegl is not.


非常感谢这段话,终于把EGL/GLX/Xegl三个名词都说清楚了。我现在非常怕名词缩写,我相信每个所写背后还是有理念的,只是无法穷尽精力去弄明白。“吾生有崖,而知无崖,以有崖求无崖,殆哉矣” 。话说这三个词真的有点绕:GLX是X Window System的OpenGL扩展(initialism for "OpenGL Extension to the X Window System") ,EGL是OpenGLES/OpenVG与平台本地窗口连接层,但是EGL是平台独立的。而Xegl呢,却是EGL在Linux上的实现。要理解得彻底,还需要引入一个名词:XGL。


Xgl is an X server architecture designed to take advantage of modern graphics cards via their OpenGL drivers, layered on top of OpenGL via glitz.上述引自wikipedia.org,XGL是一种Xserver的架构其设计目的是通过OpenGL驱动充分利用现代显卡的性能,XGL通过Glitz使用OpenGL。后半句提到了Glitz,Glitz是什么呢?是OpenGL的封装类库,Glitz不仅精确实现了X Render extension的规范,还扩展了额外的功能。从架构上说,个人觉得Glitz不应该是XGL的必要条件(XGLX就没有用到Glitz)。


freedesktop.org认为:Xegl is a new server based on the Xgl architecture.Xegl是一种XGL架构的实现。然而,在Xegl作为XGL的终极目标实现之前,XGLX提供了XGL的另一种实现,然而XGLX备受争议,NVidia这家公司明白的表示这样的XGLX发展的方向是一个错误的方向,因为该方案中XGL的后端竟然只是一个次级的OpenGL视窗(layaredserver)而不是一个独立的个体(like Xserver)。这句话理解起来太艰难,我找到了黄敬群大牛的PPT中的一张图,来说明XGLX的结构。


Xglx的架构图

 



作为对比,看看Xegl实现的XGL架构,图片同样来自黄敬群大牛的PPT图片同样来自:

 

Xegl实现的架构

原创粉丝点击