We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4899

Summary: AMD "amdgpu" proprietary driver 19.30 and OpenGL video not working
Product: SDL Reporter: cpasjuste <cpasjuste>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2    
Version: 2.0.10   
Hardware: x86_64   
OS: Linux   

Description cpasjuste 2019-12-16 14:02:41 UTC
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.
Comment 1 cpasjuste 2019-12-16 14:17:59 UTC
More information's:

Note that the testgl2 sample is working fine.
Here is the full (non working) code (that work with OpenGLES and NVIDIA OpenGL): https://github.com/Cpasjuste/libcross2d/blob/master/source/platforms/sdl2/sdl2_gl_renderer.cpp
Comment 2 Sam Lantinga 2019-12-16 18:24:09 UTC
Please contact the libcross2d author. They should be using SDL_GL_GetProcAddress() to retrieve all OpenGL functions.

Thanks!
Comment 3 cpasjuste 2019-12-16 18:28:10 UTC
I am the libcross2d author :)
I thought it was a bug as it's working fine on Nvidia and with gles2. But I got it! (I'm now using glad loader to simplify all this).

Thanks,
Cpasjuste.
Comment 4 Sam Lantinga 2019-12-16 20:38:15 UTC
*laugh* Got it. I'm glad you found a solution. :)
Comment 5 cpasjuste 2019-12-16 20:46:28 UTC
(In reply to Sam Lantinga from comment #4)
> *laugh* Got it. I'm glad you found a solution. :)

Very fun reply, not sure if it was intended ("glad"), i guess it was :)
I stop my flood now, and many thanks again for the fast support.
Comment 6 Sam Lantinga 2019-12-17 06:37:56 UTC
You're welcome!