在 Mac 上的 Ubuntu VM 上使用 Mesa/OpenGL 4.5 进行软件渲染

Software rendering with Mesa/OpenGL 4.5 on Ubuntu VM on Mac

作为学习的一部分,我必须能够编译和 运行 基于 OpenGL 4.5 的程序,而我只有 Mac 才能这样做。我在 VM 中使用 Ubuntu 以获得更适合编程的环境,但我的软件和硬件(macOS Sierra 10.12.6、Intel HD Graphics 4000)仅限于 3.3 上下文。这是附加信息(来自 Ubuntu 虚拟机的 运行):

$ glxinfo | grep 'OpenGL core'
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:

作业使用 GLFW。我一直试图让它在软件渲染中使用 Mesa(它与 llvmpipe 一起使用),以便它独立于硬件功能(如果我理解正确的话),但是当我创建 window 时总是失败尝试创建 4.5 上下文。我环顾四周并尝试使用 export LIBGL_ALWAYS_SOFTWARE=1 无济于事。构建链使用 CMAKE 来构建作业和实际的 GLFW 库,这是值得的(我注意到它使用 X11 和 xorg-dev 包)。

Mesa 是否实现了任何版本的 OpenGL 4?如果是这样,我可以在 GLFW 部分强制进行软件渲染,以便我可以创建 OpenGL 4.x 上下文吗?

Does Mesa implement any version of OpenGL 4 ?

他们的 Intel 和 Radeon 硬件驱动程序 do

... can I force software rendering on GLFW's part so that I can create an OpenGL 4.x context ?

不,Mesa 的所有软件渲染器 (softpipe, llvmpipe, & swr) 都在 OpenGL 3.3 上达到顶峰。

As of Mesa 20.2 llvmpipe supports OpenGL 4.5.