Mesa 17.2.0 renderer driver name change error, causes GLProfile not mapped initialization error
I've got some issues regarding jogl context initialization while using new Mesa 17.2.0 on my arch linux machine. To make some short summary, while using slightly older Mesa (17.1.5), GL renderer was named:
Gallium 0.4 on AMD HAWAII (DRM 3.15.0 / 4.12.12-1-ARCH, LLVM 4.0.1)
and all was working well, while the new renderer is named:
AMD Radeon R9 200 Series (AMD HAWAII / DRM 3.15.0 / 4.12.12-1-ARCH, LLVM 4.0.1)
GLContext would therefore not recognize by this new name that it is actually Mesa renderer/driver - context and profile initialization fails and things does not work at all.
Its quite easy, anyway here are some informations regarding my machine and jogl:
OS/Distro: Linux/Archlinux (up to date)
Graphics card: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT / Grenada XT [Radeon R9 290X/390X]
Video drivers: xf86-video-amdgpu-1.4.0-1-x86_64 (radeon module is blacklisted because of OpenCL incompatibility, so amdgpu module is used in all setups.)
jogl version and package is from: http://jogamp.org/deployment/v2.3.2/archive/jogamp-fat-all.7z All other important informations could be found in all of the following debug outputs....
I was able to recognize the problem just by diffing first two debug outputs (lines 212-216 quirks...) where renderer names are shown (or missing in the buggy case). After putting some breakpoints to quirks init, the issue immediately shown itself.
To sum it up, actual problem lies in function setRendererQuirks in class GLContextImpl.java on line 2116 (alternatively https://github.com/sgothel/jogl/blob/master/src/jogl/classes/jogamp/opengl/GLContextImpl.java#L2136) where:
final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ");
needs to be changed to:
final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ") || glRenderer.startsWith("AMD ");
this causes the context to be correctly initialized and things work well again. It even looks like there was already some intention to implement this Mesa AMD renderer - as seen commented 8 lines above the culprit, where:
// final String MesaRendererAMDsp = " AMD ";
I do not know whether this is the best solution as I do not see too deep to JOGL internals, so I am just documenting my findings for you this way. Hope this helps.
glVersion string could be of some help then, (loaded at GLContextImpl.java:1634 -> glGetStringInt(GL.GL_VERSION, glGetStringPtr)), returns following:
OpenGL ES 3.1 Mesa 17.2.0
Well, to be honest, it is quite a mess, according to: https://www.khronos.org/opengl/wiki/OpenGL_Context#OpenGL_version_number this could change to anything anytime as it depends on specific GL implementations.
Have a nice day.