SDL2 (2.0.8, 2.10) + amdgpu 19.30 + ubuntu 18.04

Hi,

I think i did spot a problem with SDL2, OpenGL AND the “amdgpu” proprietary drivers (v 19.30). It seems that OpenGL functions/proc addresses are not correctly set. While “SDL_GL_GetAttribute” are working fine, any call to any OpenGL function will either crash or return NULL (glGetString).

Please note that it’s working fine with NVIDIA, but also with OpenGLES 2 on the “amdgpu” proprietary drivers.

If i retrieve the function with:

const char *(*glGetString)(GLenum);
glGetString = (const char ()(GLenum)) SDL_GL_GetProcAddress(“glGetString”);

Then glGetString is working. Here is the output of the strings after “fixing” glGetString address:

GL vendor : X.Org
GL renderer : Radeon RX550/550 Series (POLARIS12, DRM 3.33.0, 5.0.0-36-generic, LLVM 9.0.0)
GL version : 4.5 (Core Profile) Mesa 19.2.0-devel
GL glsl : 4.50

Finally, note that when using glad loader, all is working fine.

I will open a bug report, but wanted to be sure it’s not something on my end.

Thanks ! :slight_smile:

If glad is working but yours isn’t, then I would either compare its code to yours and see what’s different, or just use glad.

edit: it also looks like your program winds up using Mesa instead of a proprietary driver

edit 2: you’re checking that SDL_GL_GetProcAddress() is returning something other than NULL, right?