jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7e2e6e8aa4a8eda5aab2e55b4ae20906faf3039c

commit 7e2e6e8aa4a8eda5aab2e55b4ae20906faf3039c
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Fri May 12 16:28:56 2017 +0900

    evas gl: Fix typo and revert hack (GLES 3.1)
    
    Omg... Thanks Daekwang Ryu for pointing me to my error. I remember
    struggling a lot with this OpenGL API and libGLdispatch (glvnd) when
    in fact this was all just a typo in the code.
    
    GLES 3.1 and the upcoming 3.2 support need a proper test case...
    
    See c68a40987404375b36460b6a7f5ccceb45444b57
    
    @fix
---
 src/modules/evas/engines/gl_common/evas_gl_api.c | 49 ++----------------------
 1 file changed, 4 insertions(+), 45 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c 
b/src/modules/evas/engines/gl_common/evas_gl_api.c
index 1222559..25d5d6a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -25,9 +25,6 @@
       }
 
 static void *_gles3_handle = NULL;
-#ifdef GL_GLES
-static void *_gles3_handle_fallback = NULL;
-#endif
 static Evas_GL_API _gles3_api;
 //---------------------------------------//
 // API Debug Error Checking Code
@@ -3252,7 +3249,8 @@ _evgl_load_gles3_apis(void *dl_handle, Evas_GL_API 
*funcs, int minor_version,
 
 #define ORD(name) do { \
    funcs->name = dlsym(dl_handle, #name); \
-   if (!funcs->name && get_proc_address) get_proc_address(#name); \
+   if (!funcs->name && get_proc_address) \
+     funcs->name = get_proc_address(#name); \
    if (!funcs->name) { \
         WRN("%s symbol not found", #name); \
         return ret_value; \
@@ -3369,49 +3367,10 @@ _evgl_load_gles3_apis(void *dl_handle, Evas_GL_API 
*funcs, int minor_version,
 
    if (minor_version > 0)
      {
-        // OpenGL ES 3.1
+        // OpenGL ES 3.0 is supported, return true even if 3.1 isn't there
         ret_value = EINA_TRUE;
 
-        /* HACK for libglvnd (The GL Vendor-Neutral Dispatch library)
-         *
-         * For NVIDIA driver using libglvnd, GLES 3.0 symbols are exposed in
-         * libGLESv2.so and properly forwarded to libGLESv2_nvidia.so.
-         *
-         * But for GLES 3.1+ the symbols are not present in libGLESv2.so so
-         * the following dlsym() would invariably fail. eglGetProcAddress also
-         * fails to find the symbols. I believe this is a bug in libglvnd's
-         * libEGL.so, as it should be finding the symbol in nvidia's library.
-         *
-         * So we try here to link directly to the vendor library. This is ugly,
-         * but this makes GLES 3.1 work.
-         *
-         * FIXME: This hack should be removed when libglvnd fixes support
-         * for GLES 3.1+ properly.
-         */
-
-        funcs->glDispatchCompute = dlsym(dl_handle, "glDispatchCompute");
-        if (!funcs->glDispatchCompute && get_proc_address)
-          get_proc_address("glDispatchCompute");
-#ifdef GL_GLES
-        if (!funcs->glDispatchCompute)
-          {
-             const char *vendor;
-
-             vendor = (const char *) funcs->glGetString(GL_VENDOR);
-             if (!vendor) return ret_value;
-
-             // FIXME: Add other support for other vendors
-             if (!strcmp(vendor, "NVIDIA Corporation"))
-               _gles3_handle_fallback = dlopen("libGLESv2_nvidia.so", 
RTLD_NOW);
-
-             if (!_gles3_handle_fallback) return ret_value;
-             dl_handle = _gles3_handle_fallback;
-             get_proc_address = NULL;
-          }
-#else
-        if (!funcs->glDispatchCompute) return ret_value;
-#endif
-
+        // OpenGL ES 3.1
         ORD(glDispatchCompute);
         ORD(glDispatchComputeIndirect);
         ORD(glDrawArraysIndirect);

-- 


Reply via email to