OSDN Git Service

egl_glx: Try first a default lookup for glXGetProcAddress before loading dynamic...
authorBeren Minor <beren.minor@gmail.com>
Fri, 25 Nov 2011 10:58:38 +0000 (11:58 +0100)
committerChia-I Wu <olv@lunarg.com>
Sun, 27 Nov 2011 03:22:24 +0000 (11:22 +0800)
commit6baa5f10c04641960e0bedce664d0a5cf39e8954
treed9ecac333c09df5f18efac062e3f600eaee87364
parent496f68bb9d3760075c4a446ddf832dce6cf6cbc7
egl_glx: Try first a default lookup for glXGetProcAddress before loading dynamic lib.

GLX functions are sometimes directly available in the current binary. In such
cases, we do not need any alternate library loaded using dlopen. Otherwise,
dlopen may find the wrong libGL library and get functions that conflicts with
the current loaded ones.

For example, on Debian Sid with nvidia binary drivers, using mesa's libEGL with
GLX driver leads to wrong glXGetFBConfigs symbol loaded (or loaded twice?),
which leads to "GLX: failed to create any config" error message as the
glXGetFBConfigs symbol seems to return garbage. If the binary is linked with
nvidia's libGL, the GLX symbols are already available.
Without this patch, convert_fbconfig (src/egl/drivers/glx/egl_glx.c:233) fails
for every config found, after glXGetFBConfigAttrib(... GLX_RENDER_TYPE, ...)
call, as the value returned has GLX_COLOR_INDEX_BIT and not GLX_RGBA_BIT.

[olv: initialize handle, prepend egl_glx to the commit log]
src/egl/drivers/glx/egl_glx.c