If EGL is defined, we could use the eglGetProcAddress to lookup extension proc addresses.
Note, however, that eglGetProcAddress does not work for core procs [0]. Returning NULL will cause the process to crash... but shouldn't we be using piglit for EGL dispatch, anyway? [0] Unless the driver also supports EGL_KHR_get_all_proc_addresses. Signed-off-by: Daniel Kurtz <[email protected]> --- tests/util/piglit-dispatch-init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/util/piglit-dispatch-init.c b/tests/util/piglit-dispatch-init.c index 936005b..22318a3 100644 --- a/tests/util/piglit-dispatch-init.c +++ b/tests/util/piglit-dispatch-init.c @@ -33,8 +33,10 @@ #else /* Linux */ -#ifdef PIGLIT_HAS_GLX -#include "glxew.h" +#if defined(PIGLIT_HAS_GLX) +# include "glxew.h" +#elif defined(PIGLIT_HAS_EGL) +# include <EGL/egl.h> #endif #endif @@ -145,8 +147,10 @@ get_core_proc_address(const char *function_name, int gl_10x_version) static piglit_dispatch_function_ptr get_ext_proc_address(const char *function_name) { -#ifdef PIGLIT_HAS_GLX +#if defined(PIGLIT_HAS_GLX) return glXGetProcAddressARB((const GLubyte *) function_name); +#elif defined(PIGLIT_HAS_EGL) + return eglGetProcAddress(function_name); #else (void)function_name; return (piglit_dispatch_function_ptr)NULL; -- 1.8.5.2 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
