首页 > 解决方案 > 如何在 Linux 中了解 OpenGL 版本并安装最新版本

问题描述

输出glxinfo | grep "OpenGL"

OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 20.0.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

我不明白那个输出,
什么是版本?以及“OpenGL 版本字符串”和“OpenGL 核心配置文件版本字符串”有什么区别。

以及我应该升级我的 OpenGL 的 linux 命令

标签: linuxopengl

解决方案


要了解此命令的输出,您应该知道现代 OpenGL 实现支持多个配置文件。每个配置文件都包含完整 OpenGL 功能的一个子集。Profile可以通过不同的版本演变。

具体来说,您的系统支持三种配置文件:

  • 核心配置文件:这是最现代的 OpenGL 配置文件。使用此上下文的应用程序可以访问最新的 OpenGL 功能,但不能访问传统的 OpenGL 功能,如立即模式(glBegin 和朋友)。您的系统有 4.6,这是当前最新的。
  • 兼容性配置文件:此配置文件仍然支持传统的 OpenGL 功能,但也通过扩展支持一些较新的功能。您不应将其用于新应用程序,而应仅用于运行旧应用程序。
  • OpenGL ES:此配置文件是为移动系统设计的,但也越来越多地用于桌面应用程序。将其视为 OpenGL 的一个小子集,它适用于不需要完整 OpenGL 工具包的应用程序。您拥有 OpenGL ES 3.2,它也是当前最新的。

总而言之:您的系统是最新的,您应该能够创建和运行使用核心或 ES 配置文件的现代 OpenGL 应用程序,以及使用兼容性配置文件的旧版 OpenGL 应用程序。


推荐阅读