jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=88fc0e0568c617348819795231038af5c2f314f5

commit 88fc0e0568c617348819795231038af5c2f314f5
Author: mythri.venugopal <mythri.venugo...@samsung.com>
Date:   Mon Feb 23 19:39:42 2015 +0900

    Evas GL: Fix issues in gles extensions initialisation
    
    Summary:
    Fix 1- If extension is not listed in GL_EXTENSIONS, do not try
    to get the function address of the extension functions.
    Fix 2- For GL_EXT_robustness, for GLESv1 version, do not try to
    export glGetnUniformXXX functions.
    
    Reviewers: jpeg
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1965
    
    Signed-off-by: Jean-Philippe Andre <jp.an...@samsung.com>
---
 .../evas/engines/gl_common/evas_gl_api_ext.c       | 47 ++++++++++++++++++++--
 .../evas/engines/gl_common/evas_gl_api_ext.h       |  8 ++++
 .../evas/engines/gl_common/evas_gl_api_ext_def.h   | 16 ++++++--
 3 files changed, 63 insertions(+), 8 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index f79c1ce..248b476 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -33,6 +33,8 @@ typedef _getproc_fn (*fp_getproc)(const char *);
    ret (*gl_ext_sym_##name) param = NULL; \
    ret (*gles1_ext_sym_##name) param = NULL;
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
 
@@ -46,6 +48,8 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
/////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -63,6 +67,8 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
 
@@ -76,6 +82,8 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
/////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -354,12 +362,16 @@ re->info->info.screen);
 
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
      { \
-        ret (**drvfunc)param = &gl_ext_sym_##name;
+        ret (**drvfunc)param = &gl_ext_sym_##name; \
+        if (*ext_support == 1) \
+          {
 
 #define _EVASGL_EXT_FUNCTION_END() \
+          } \
         if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
      }
-
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \
    if ((*drvfunc) == NULL) *drvfunc = name;
 
@@ -389,6 +401,8 @@ re->info->info.screen);
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
@@ -417,6 +431,8 @@ re->info->info.screen);
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
 
@@ -430,6 +446,8 @@ re->info->info.screen);
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
    
/////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -467,6 +485,8 @@ evgl_api_ext_get(Evas_GL_API *gl_funcs)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
    ORD(name);
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
@@ -486,6 +506,8 @@ evgl_api_ext_get(Evas_GL_API *gl_funcs)
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
@@ -589,12 +611,19 @@ _evgl_api_gles1_ext_init(void)
 
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
      { \
-        ret (**drvfunc)param = &gles1_ext_sym_##name;
+        ret (**drvfunc)param = &gles1_ext_sym_##name; \
+        if (*ext_support == 1) \
+          {
 
 #define _EVASGL_EXT_FUNCTION_END() \
+          } \
         if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
      }
-
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN() \
+   if (EINA_FALSE) \
+     {
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END() \
+     }
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \
    if ((*drvfunc) == NULL) *drvfunc = name;
 
@@ -626,6 +655,8 @@ _evgl_api_gles1_ext_init(void)
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 #undef GETPROCADDR
@@ -645,6 +676,8 @@ _evgl_api_gles1_ext_init(void)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
 
@@ -658,6 +691,8 @@ _evgl_api_gles1_ext_init(void)
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
@@ -709,6 +744,8 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
    ORD(name);
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
@@ -727,6 +764,8 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs)
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h
index 17a2ffd..c9e13b5 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h
@@ -27,6 +27,8 @@
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) extern ret 
(*gl_ext_sym_##name) param;
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
 
@@ -40,6 +42,8 @@
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
/////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -57,6 +61,8 @@
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
 
@@ -70,6 +76,8 @@
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
+#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
/////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
index 879b367..a3a968b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
@@ -29,6 +29,12 @@
 // End of the extension function block
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
+// These functions will not be considered for export for GLESv1
+// Begin of the glesv1 bypass function block
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+// End of the glesv1 bypass function block
+#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
+
 // Driver extension functions to wrap (name : SPEC extension function name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 
@@ -1020,14 +1026,16 @@ _EVASGL_EXT_BEGIN(robustness)
                 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glReadnPixels")
                 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glReadnPixelsEXT")
         _EVASGL_EXT_FUNCTION_END()
-        _EVASGL_EXT_FUNCTION_BEGIN(void, glGetnUniformfvEXT, (GLuint program, 
GLint location, GLsizei bufSize, float *params))
+        _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
+           _EVASGL_EXT_FUNCTION_BEGIN(void, glGetnUniformfvEXT, (GLuint 
program, GLint location, GLsizei bufSize, float *params))
                 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glGetnUniformfv")
                 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glGetnUniformfvEXT")
-        _EVASGL_EXT_FUNCTION_END()
-        _EVASGL_EXT_FUNCTION_BEGIN(void, glGetnUniformivEXT, (GLuint program, 
GLint location, GLsizei bufSize, GLint *params))
+           _EVASGL_EXT_FUNCTION_END()
+           _EVASGL_EXT_FUNCTION_BEGIN(void, glGetnUniformivEXT, (GLuint 
program, GLint location, GLsizei bufSize, GLint *params))
                 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glGetnUniformiv")
                 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glGetnUniformivEXT")
-        _EVASGL_EXT_FUNCTION_END()
+           _EVASGL_EXT_FUNCTION_END()
+        _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 _EVASGL_EXT_END()
 
 _EVASGL_EXT_BEGIN(sRGB)

-- 


Reply via email to