c++macosubuntuopenglmesa

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


As part of my studies, I have to be able to compile and run OpenGL 4.5-based programs, and I only have a Mac to do so. I am using Ubuntu in a VM to have a more programming-friendly environment, but my software and hardware (macOS Sierra 10.12.6, Intel HD Graphics 4000) is limited to 3.3 contexts. Here is additional info (ran from the Ubuntu VM) :

$ 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:

The assignments use GLFW. I've been trying to get it to use Mesa (which it does, with llvmpipe) with software rendering so that it is independent from the hardware capabilities (if I understand correctly), but the window creation always fails when I try to create a 4.5 context. I looked around and tried using export LIBGL_ALWAYS_SOFTWARE=1 to no avail. The build chain uses CMAKE to build both the assignments and the actual GLFW lib, for what it's worth (I noticed that it uses X11 with the xorg-dev packages).

Does Mesa implement any version of OpenGL 4 ? If it does, can I force software rendering on GLFW's part so that I can create an OpenGL 4.x context ?


Solution

  • Does Mesa implement any version of OpenGL 4 ?

    Their Intel & Radeon hardware drivers do.

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

    Nope, all of Mesa's software renderers (softpipe, llvmpipe, & swr) top out at OpenGL 3.3.

    As of Mesa 20.2 llvmpipe supports OpenGL 4.5.