Fix invalid fallback routins. 18/261918/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20211028.113924 accepted/tizen/unified/20210802.135707 submit/tizen/20210727.093930 submit/tizen/20210802.011415 submit/tizen_6.5/20211028.163101 tizen_6.5.m2_release
authorJoonbum Ko <joonbum.ko@samsung.com>
Thu, 29 Jul 2021 01:22:46 +0000 (10:22 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Thu, 29 Jul 2021 01:22:46 +0000 (10:22 +0900)
Change-Id: I82b8bb8e6125f0da6b0768c3f0ded491b4556118
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/coregl.c

index 87437f5..225681e 100644 (file)
@@ -172,8 +172,8 @@ _gl_lib_init(void)
                                           _COREGL_VENDOR_EGL_LIB_PATH);
                        COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
                                           _COREGL_VENDOR_EGL_LIB_PATH_LEGACY);
+                       return 0;
                }
-               return 0;
        }
 
        // test for invalid linking egl
@@ -196,17 +196,19 @@ _gl_lib_init(void)
                                                   _COREGL_VENDOR_GLV1_LIB_PATH);
                                COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
                                                   _COREGL_VENDOR_GLV1_LIB_PATH_LEGACY);
-                       }
-               } else {
-                       // test for invalid linking gl
-                       if (dlsym(gl_lib_handle, "coregl_symbol_exported")) {
-                               COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
-                                                  _COREGL_VENDOR_GLV1_LIB_PATH);
                                return 0;
                        }
-                       COREGL_DBG("Driver GL version 1.1");
-                       _gl_sym_init(COREGL_GLAPI_1);
                }
+
+               // test for invalid linking gl
+               if (dlsym(gl_lib_handle, "coregl_symbol_exported")) {
+                       COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
+                                          _COREGL_VENDOR_GLV1_LIB_PATH);
+                       return 0;
+               }
+               COREGL_DBG("Driver GL version 1.1");
+               _gl_sym_init(COREGL_GLAPI_1);
+
        } else if (driver_gl_version == COREGL_GLAPI_2) {
                // in case of driver library is separated
                gl_lib_handle = dlopen(_COREGL_VENDOR_GLV1_LIB_PATH, RTLD_LAZY | RTLD_LOCAL);
@@ -226,33 +228,34 @@ _gl_lib_init(void)
                                                   _COREGL_VENDOR_GLV2_LIB_PATH);
                                COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
                                                   _COREGL_VENDOR_GLV2_LIB_PATH_LEGACY);
-                       }
-               } else {
-                       // test for invalid linking gl
-                       if (dlsym(gl_lib_handle, "coregl_symbol_exported")) {
-                               COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
-                                                  _COREGL_VENDOR_GLV2_LIB_PATH);
                                return 0;
                        }
+               }
 
-                       // test for a GLES 3.x symbol
-                       if (dlsym(gl_lib_handle, "glBlendBarrier")) {
-                               COREGL_DBG("Driver GL version 3.2");
-                               driver_gl_version = COREGL_GLAPI_32;
-                       } else if (dlsym(gl_lib_handle, "glBindProgramPipeline")) {
-                               COREGL_DBG("Driver GL version 3.1");
-                               driver_gl_version = COREGL_GLAPI_31;
-                       } else if (dlsym(gl_lib_handle, "glReadBuffer")) {
-                               COREGL_DBG("Driver GL version 3.0");
-                               driver_gl_version = COREGL_GLAPI_3;
-                       } else {
-                               COREGL_DBG("Driver GL version 2.0");
-                       }
+               // test for invalid linking gl
+               if (dlsym(gl_lib_handle, "coregl_symbol_exported")) {
+                       COREGL_ERR("Invalid library link! (Check linkage of libCOREGL -> %s)",
+                                          _COREGL_VENDOR_GLV2_LIB_PATH);
+                       return 0;
+               }
 
-                       _gl_sym_init(COREGL_GLAPI_2);
+               // test for a GLES 3.x symbol
+               if (dlsym(gl_lib_handle, "glBlendBarrier")) {
+                       COREGL_DBG("Driver GL version 3.2");
+                       driver_gl_version = COREGL_GLAPI_32;
+               } else if (dlsym(gl_lib_handle, "glBindProgramPipeline")) {
+                       COREGL_DBG("Driver GL version 3.1");
+                       driver_gl_version = COREGL_GLAPI_31;
+               } else if (dlsym(gl_lib_handle, "glReadBuffer")) {
+                       COREGL_DBG("Driver GL version 3.0");
+                       driver_gl_version = COREGL_GLAPI_3;
+               } else {
+                       COREGL_DBG("Driver GL version 2.0");
                }
-       }
 
+               _gl_sym_init(COREGL_GLAPI_2);
+
+       }
 
        return 1;
 }