diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-03-14 14:45:50 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-03-14 15:03:25 +0900 |
commit | c15fee9bccabaef9cf25c63c979bcf1c1b581906 (patch) | |
tree | b334884d6f1b701b4da94a2db9f9ca4b3697d756 | |
parent | 3103c551f5e7622e47c4f4ea27a9012f86b8f127 (diff) | |
download | efl-c15fee9bccabaef9cf25c63c979bcf1c1b581906.tar.gz |
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
-rw-r--r-- | src/modules/evas/engines/software_generic/evas_engine.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 039459c9a2..0d2bced46e 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -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; } //--------------------------------------------------------------// |