forked from enlightenment/efl
evas gl: Fix usage of OSMesa
It seems OSMesa was recently updated to not expose symbols statically, so dlsym() returns invariably NULL. GetProcAddress must be used. Note though that the extension "EGL_KHR_get_all_proc_addresses" is not present (OSMesa is OpenGL, not GLES), and there is anyway no list of extensions in OSMesa (at the WSI level, glGetString() returns a ton of GL extensions as expected). My OSMesa version is 11.2.0 (mesa 17.0.1). This fixes make check. @fix
This commit is contained in:
parent
3103c551f5
commit
c15fee9bcc
|
@ -4872,14 +4872,20 @@ glue_sym_init(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
static Eina_Bool
|
||||
gl_sym_init(void)
|
||||
{
|
||||
Eina_Bool ok = EINA_TRUE;
|
||||
|
||||
//------------------------------------------------//
|
||||
#define FINDSYM(dst, sym, typ) \
|
||||
#define FINDSYM(dst, sym, typ) do { \
|
||||
if (!dst) dst = (typeof(dst))dlsym(gl_lib_handle, sym); \
|
||||
if (!dst) DBG("Symbol not found: %s", sym);
|
||||
#define FALLBAK(dst, typ) if (!dst) dst = (typeof(dst))sym_missing;
|
||||
if (!dst && _sym_OSMesaGetProcAddress) dst = (typeof(dst))_sym_OSMesaGetProcAddress(sym); \
|
||||
if (!dst) DBG("Symbol not found: %s", sym); \
|
||||
} while (0)
|
||||
#define FALLBAK(dst, typ) do { \
|
||||
if (!dst) { dst = (typeof(dst))sym_missing; ok = EINA_FALSE; } \
|
||||
} while (0)
|
||||
|
||||
//------------------------------------------------------//
|
||||
// GLES 2.0 APIs...
|
||||
|
@ -5326,7 +5332,10 @@ gl_sym_init(void)
|
|||
gl_lib_is_gles = 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
if (!ok)
|
||||
ERR("Evas failed to initialize OSMesa for OpenGL with the software engine!");
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------//
|
||||
|
|
Loading…
Reference in New Issue