Skip to content

Commit

Permalink
Merge pull request #257 from batesj/allow_libopengl
Browse files Browse the repository at this point in the history
Allow libopengl.so to be used when GLX_LIB is missing
  • Loading branch information
ebassi authored Jul 12, 2021
2 parents ad723a7 + 7975061 commit ecfa8e0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/dispatch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,23 @@ epoxy_load_gl(void)
get_dlopen_handle(&api.gl_handle, OPENGL_LIB, true, true);
#else

// Prefer GLX_LIB over OPENGL_LIB to maintain existing behavior.
// Using the inverse ordering OPENGL_LIB -> GLX_LIB, causes issues such as:
// https://github.com/anholt/libepoxy/issues/240 (apitrace missing calls)
// https://github.com/anholt/libepoxy/issues/252 (Xorg boot crash)
get_dlopen_handle(&api.glx_handle, GLX_LIB, false, true);
api.gl_handle = api.glx_handle;

#if defined(OPENGL_LIB)
if (!api.gl_handle)
get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true);
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) {
fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB);
abort();
}

#endif
}

Expand Down

0 comments on commit ecfa8e0

Please sign in to comment.