summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-14 14:45:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-14 15:03:25 +0900
commitc15fee9bccabaef9cf25c63c979bcf1c1b581906 (patch)
treeb334884d6f1b701b4da94a2db9f9ca4b3697d756
parent3103c551f5e7622e47c4f4ea27a9012f86b8f127 (diff)
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.c19
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)
4872 return 1; 4872 return 1;
4873} 4873}
4874 4874
4875static int 4875static Eina_Bool
4876gl_sym_init(void) 4876gl_sym_init(void)
4877{ 4877{
4878 Eina_Bool ok = EINA_TRUE;
4879
4878 //------------------------------------------------// 4880 //------------------------------------------------//
4879#define FINDSYM(dst, sym, typ) \ 4881#define FINDSYM(dst, sym, typ) do { \
4880 if (!dst) dst = (typeof(dst))dlsym(gl_lib_handle, sym); \ 4882 if (!dst) dst = (typeof(dst))dlsym(gl_lib_handle, sym); \
4881 if (!dst) DBG("Symbol not found: %s", sym); 4883 if (!dst && _sym_OSMesaGetProcAddress) dst = (typeof(dst))_sym_OSMesaGetProcAddress(sym); \
4882#define FALLBAK(dst, typ) if (!dst) dst = (typeof(dst))sym_missing; 4884 if (!dst) DBG("Symbol not found: %s", sym); \
4885 } while (0)
4886#define FALLBAK(dst, typ) do { \
4887 if (!dst) { dst = (typeof(dst))sym_missing; ok = EINA_FALSE; } \
4888 } while (0)
4883 4889
4884 //------------------------------------------------------// 4890 //------------------------------------------------------//
4885 // GLES 2.0 APIs... 4891 // GLES 2.0 APIs...
@@ -5326,7 +5332,10 @@ gl_sym_init(void)
5326 gl_lib_is_gles = 1; 5332 gl_lib_is_gles = 1;
5327 } 5333 }
5328 5334
5329 return 1; 5335 if (!ok)
5336 ERR("Evas failed to initialize OSMesa for OpenGL with the software engine!");
5337
5338 return ok;
5330} 5339}
5331 5340
5332//--------------------------------------------------------------// 5341//--------------------------------------------------------------//