Avoid using eglGPA() for core funcs when the current context is GLX.

If you already had GLX loaded by epoxy, this wouldn't happen, but on
the first call, fallback cases might have taken the EGL path if EGL
was loaded.
macos/v1.5.9
Eric Anholt 11 years ago
parent b670c84039
commit 847a6d50db
  1. 9
      src/dispatch_common.c

@ -517,6 +517,11 @@ epoxy_get_proc_address(const char *name)
#else #else
if (api.glx_handle && glXGetCurrentContext()) { if (api.glx_handle && glXGetCurrentContext()) {
return glXGetProcAddressARB((const GLubyte *)name); return glXGetProcAddressARB((const GLubyte *)name);
#if PLATFORM_HAS_EGL
} else if (api.egl_handle &&
epoxy_egl_get_current_gl_context_api() != EGL_NONE) {
return eglGetProcAddress(name);
#endif /* PLATFORM_HAS_EGL */
} else { } else {
/* If the application hasn't explicitly called some of our GLX /* If the application hasn't explicitly called some of our GLX
* or EGL code but has presumably set up a context on its own, * or EGL code but has presumably set up a context on its own,
@ -536,7 +541,7 @@ epoxy_get_proc_address(const char *name)
#if PLATFORM_HAS_EGL #if PLATFORM_HAS_EGL
egl_gpa = dlsym(NULL, "eglGetProcAddress"); egl_gpa = dlsym(NULL, "eglGetProcAddress");
if (egl_gpa) if (egl_gpa && epoxy_egl_get_current_gl_context_api() != EGL_NONE)
return egl_gpa(name); return egl_gpa(name);
#endif /* PLATFORM_HAS_EGL */ #endif /* PLATFORM_HAS_EGL */
@ -552,7 +557,7 @@ epoxy_get_proc_address(const char *name)
#if PLATFORM_HAS_EGL #if PLATFORM_HAS_EGL
egl_gpa = do_dlsym(&api.egl_handle, "libEGL.so.1", "eglGetProcAddress", egl_gpa = do_dlsym(&api.egl_handle, "libEGL.so.1", "eglGetProcAddress",
false); false);
if (egl_gpa) if (egl_gpa && epoxy_egl_get_current_gl_context_api() != EGL_NONE)
return egl_gpa(name); return egl_gpa(name);
#endif /* PLATFORM_HAS_EGL */ #endif /* PLATFORM_HAS_EGL */

Loading…
Cancel
Save