From dbfa4b209c0712b67dfeb8366c2ebe8503063b52 Mon Sep 17 00:00:00 2001 From: Yaroslav Isakov Date: Wed, 29 Jul 2020 16:40:01 +0200 Subject: [PATCH 1/2] If glvnd library found, do not use libGL.so in epoxy_load_gl Without additional check, even if libOpenGL was loaded, libGL.so will be loaded as well, and used both in gl_handle and glx_handle, so libglvnd libraries will not be used. Reviewed-by: Adam Jackson Signed-off-by: Emmanuele Bassi --- src/dispatch_common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 9977a02..cfc9dcc 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -674,9 +674,12 @@ epoxy_load_gl(void) if (!api.gl_handle) get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); #endif - - get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true); - api.gl_handle = api.glx_handle; + if (!api.gl_handle) { + get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); +#if PLATFORM_HAS_GLX + api.glx_handle = api.gl_handle; +#endif + } #endif } From 4994c48172e94ca81c000597e0abc0ea0e682b3c Mon Sep 17 00:00:00 2001 From: Yaroslav Isakov Date: Wed, 29 Jul 2020 22:29:50 +0200 Subject: [PATCH 2/2] Do not overwrite glx_handle in epoxy_load_gl if GLX library is loaded already Reviewed-by: Adam Jackson Signed-off-by: Emmanuele Bassi --- src/dispatch_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index cfc9dcc..62b7134 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -677,7 +677,8 @@ epoxy_load_gl(void) if (!api.gl_handle) { get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); #if PLATFORM_HAS_GLX - api.glx_handle = api.gl_handle; + if (!api.glx_handle) + api.glx_handle = api.gl_handle; #endif } #endif