forked from enlightenment/efl
evas/gl_x11: Separate gl symbols check
Summary: There is a restriction for some gpu drivers that eglGetProcAddress must be called after eglMakeCurrent. So separate egl/glx extensions check from gl_symbols to be called inside eng_window_new. Test Plan: egl and glx backend tests Reviewers: cedric, jpeg Subscribers: cedric, mer.kim, wonsik Differential Revision: https://phab.enlightenment.org/D2193
This commit is contained in:
parent
6638c7af90
commit
69fa047048
|
@ -1293,6 +1293,36 @@ gl_symbols(void)
|
|||
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressEXT", glsym_func_eng_fn);
|
||||
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressARB", glsym_func_eng_fn);
|
||||
FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddress", glsym_func_eng_fn);
|
||||
#else
|
||||
#define FINDSYM(dst, sym, typ) \
|
||||
if (glsym_glXGetProcAddress) { \
|
||||
if (!dst) dst = (typ)glsym_glXGetProcAddress(sym); \
|
||||
} else { \
|
||||
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym); \
|
||||
}
|
||||
|
||||
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddressEXT", glsym_func_eng_fn);
|
||||
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddressARB", glsym_func_eng_fn);
|
||||
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddress", glsym_func_eng_fn);
|
||||
#endif
|
||||
|
||||
done = 1;
|
||||
}
|
||||
|
||||
void
|
||||
eng_gl_symbols(void)
|
||||
{
|
||||
static int done = 0;
|
||||
|
||||
if (done) return;
|
||||
|
||||
#ifdef GL_GLES
|
||||
#define FINDSYM(dst, sym, typ) \
|
||||
if (glsym_eglGetProcAddress) { \
|
||||
if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \
|
||||
} else { \
|
||||
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym); \
|
||||
}
|
||||
|
||||
glsym_evas_gl_symbols((void*)glsym_eglGetProcAddress);
|
||||
|
||||
|
@ -1321,10 +1351,6 @@ gl_symbols(void)
|
|||
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym); \
|
||||
}
|
||||
|
||||
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddressEXT", glsym_func_eng_fn);
|
||||
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddressARB", glsym_func_eng_fn);
|
||||
FINDSYM(glsym_glXGetProcAddress, "glXGetProcAddress", glsym_func_eng_fn);
|
||||
|
||||
glsym_evas_gl_symbols((void*)glsym_glXGetProcAddress);
|
||||
|
||||
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageEXT", glsym_func_void);
|
||||
|
|
|
@ -198,6 +198,7 @@ Evas_Engine_GL_Context *eng_outbuf_gl_context_get(Outbuf *ob);
|
|||
void *eng_outbuf_egl_display_get(Outbuf *ob);
|
||||
|
||||
Eina_Bool eng_preload_make_current(void *data, void *doit);
|
||||
void eng_gl_symbols(void);
|
||||
|
||||
static inline int
|
||||
_re_wincheck(Outbuf *ob)
|
||||
|
|
|
@ -463,6 +463,7 @@ try_gles2:
|
|||
gw->detected.msaa = val;
|
||||
#endif
|
||||
|
||||
eng_gl_symbols();
|
||||
gw->gl_context = glsym_evas_gl_common_context_new();
|
||||
if (!gw->gl_context)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue