[Title] Fixed error reports in the symbol checking routine
authorHaegeun Park <haegeun.park@samsung.com>
Mon, 11 Nov 2013 05:10:59 +0000 (21:10 -0800)
committerHaegeun Park <haegeun.park@samsung.com>
Mon, 11 Nov 2013 06:47:18 +0000 (22:47 -0800)
[Issue#]
[Problem]
[Cause]
[Solution]
- Some ES3.0 APIs for fastpath are temporally opened.

src/coregl.c
src/modules/fastpath/coregl_fastpath.c
src/modules/fastpath/coregl_fastpath_gl.c
src/wraps/coregl_egl.c
src/wraps/coregl_gl.c

index ebd3b58..f3f248f 100755 (executable)
@@ -75,28 +75,26 @@ _sym_missing()
        COREGL_ERR("GL symbol missing! Check client version!\n");
 }
 
+#define FINDSYM(libhandle, getproc, dst, sym) \
+   if (!dst || (void *)dst == (void *)_sym_missing) \
+               if (getproc) dst = (__typeof__(dst))getproc(sym); \
+   if (!dst || (void *)dst == (void *)_sym_missing) \
+               dst = (__typeof__(dst))dlsym(libhandle, sym); \
+       if (!dst) dst = (__typeof__(dst))_sym_missing;
+
 static int
 _glue_sym_init(void)
 {
 
-#define FINDSYM(libhandle, getproc, dst, sym) \
-   if ((!dst) && (getproc)) dst = (__typeof__(dst))getproc(sym); \
-   if (!dst) dst = (__typeof__(dst))dlsym(libhandle, sym);
-
-#define FALLBAK(dst) \
-   if (!dst) { dst = (__typeof__(dst))_sym_missing; }
-
 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) \
-    FINDSYM(egl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME); \
-    if (IS_EXTENSION == GL_TRUE) { \
-       FINDSYM(egl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME"EXT"); \
-       FINDSYM(egl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME"KHR"); \
-    } else { FALLBAK(_sym_##FUNC_NAME); }
+    FINDSYM(egl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME);
+#define _COREGL_EXT_SYMBOL_ALIAS(FUNC_NAME, ALIAS_NAME) \
+    FINDSYM(egl_lib_handle, _sym_eglGetProcAddress, _sym_##ALIAS_NAME, #FUNC_NAME);
+
 #include "headers/sym_egl.h"
-#undef _COREGL_SYMBOL
 
-#undef FINDSYM
-#undef FALLBAK
+#undef _COREGL_EXT_SYMBOL_ALIAS
+#undef _COREGL_SYMBOL
 
        return 1;
 }
@@ -105,27 +103,22 @@ static int
 _gl_sym_init(void)
 {
 
-#define FINDSYM(libhandle, getproc, dst, sym) \
-   if ((!dst) && (getproc)) dst = (__typeof__(dst))getproc(sym); \
-   if (!dst) dst = (__typeof__(dst))dlsym(gl_lib_handle, sym);
-#define FALLBAK(dst) \
-   if (!dst) { dst = (__typeof__(dst))_sym_missing; }
-
 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) \
-    FINDSYM(gl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME); \
-    if (IS_EXTENSION == GL_TRUE) { \
-       FINDSYM(gl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME"EXT"); \
-       FINDSYM(gl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME"OES"); \
-     } else { FALLBAK(_sym_##FUNC_NAME); }
+    FINDSYM(gl_lib_handle, _sym_eglGetProcAddress, _sym_##FUNC_NAME, #FUNC_NAME);
+#define _COREGL_EXT_SYMBOL_ALIAS(FUNC_NAME, ALIAS_NAME) \
+    FINDSYM(gl_lib_handle, _sym_eglGetProcAddress, _sym_##ALIAS_NAME, #FUNC_NAME);
+
 #include "headers/sym_gl.h"
-#undef _COREGL_SYMBOL
 
-#undef FINDSYM
-#undef FALLBAK
+#undef _COREGL_EXT_SYMBOL_ALIAS
+#undef _COREGL_SYMBOL
 
        return 1;
 }
 
+#undef FINDSYM
+
+
 COREGL_API void coregl_symbol_exported()
 {
        COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL)\E[0m\n");
index 562d861..c944e2e 100644 (file)
@@ -298,11 +298,6 @@ fastpath_apply_overrides_gl(int enable)
                /* ES 3.0 BLOCK */
                COREGL_OVERRIDE(fastpath_, glReadBuffer);
                COREGL_OVERRIDE(fastpath_, glDrawRangeElements);
-               COREGL_OVERRIDE(fastpath_, glTexImage3D);
-               COREGL_OVERRIDE(fastpath_, glTexSubImage3D);
-               COREGL_OVERRIDE(fastpath_, glCopyTexSubImage3D);
-               COREGL_OVERRIDE(fastpath_, glCompressedTexImage3D);
-               COREGL_OVERRIDE(fastpath_, glCompressedTexSubImage3D);
                COREGL_OVERRIDE(fastpath_, glGenQueries);
                COREGL_OVERRIDE(fastpath_, glDeleteQueries);
                COREGL_OVERRIDE(fastpath_, glIsQuery);
@@ -319,8 +314,6 @@ fastpath_apply_overrides_gl(int enable)
                COREGL_OVERRIDE(fastpath_, glUniformMatrix4x2fv);
                COREGL_OVERRIDE(fastpath_, glUniformMatrix3x4fv);
                COREGL_OVERRIDE(fastpath_, glUniformMatrix4x3fv);
-               COREGL_OVERRIDE(fastpath_, glBlitFramebuffer);
-               COREGL_OVERRIDE(fastpath_, glRenderbufferStorageMultisample);
                COREGL_OVERRIDE(fastpath_, glFramebufferTextureLayer);
                COREGL_OVERRIDE(fastpath_, glMapBufferRange);
                COREGL_OVERRIDE(fastpath_, glFlushMappedBufferRange);
@@ -395,7 +388,6 @@ fastpath_apply_overrides_gl(int enable)
                COREGL_OVERRIDE(fastpath_, glGetProgramBinary); // OPEN
                COREGL_OVERRIDE(fastpath_, glProgramBinary); // OPEN
                COREGL_OVERRIDE(fastpath_, glProgramParameteri);
-               COREGL_OVERRIDE(fastpath_, glInvalidateFramebuffer);
                COREGL_OVERRIDE(fastpath_, glInvalidateSubFramebuffer);
                COREGL_OVERRIDE(fastpath_, glTexStorage2D);
                COREGL_OVERRIDE(fastpath_, glTexStorage3D);
index 76760ba..17d0628 100644 (file)
@@ -4118,66 +4118,6 @@ finish:
 }
 
 void
-fastpath_glTexImage3D(GLenum target, GLint level, GLint GLinternalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glTexImage3D(target, level, GLinternalFormat, width, height, depth, border, format, type, pixels);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
-fastpath_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
-fastpath_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
-fastpath_glCompressedTexImage3D(GLenum target, GLint level, GLenum GLinternalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glCompressedTexImage3D(target, level, GLinternalformat, width, height, depth, border, imageSize, data);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
-fastpath_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
 fastpath_glGenQueries(GLsizei n, GLuint* ids)
 {
        _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
@@ -4376,31 +4316,6 @@ finish:
 }
 
 void
-fastpath_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
-fastpath_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-
-}
-
-void
 fastpath_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
 {
        _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
@@ -5296,18 +5211,6 @@ finish:
 }
 
 void
-fastpath_glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
-{
-       _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
-       _orig_fastpath_glInvalidateFramebuffer(target, numAttachments, attachments);
-
-       goto finish;
-
-finish:
-       _COREGL_FASTPATH_FUNC_END();
-}
-
-void
 fastpath_glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
 {
        _COREGL_FASTPATH_FUNC_BEGIN();  SIGILL_ERROR(); // BLOCK API
index 567b178..751b936 100755 (executable)
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <dlfcn.h>
 
-// Include GL/EGL/GLX types
 # include <EGL/eglplatform.h>
 # include "../headers/egl.h"
 
@@ -19,7 +18,9 @@ typedef void (*_eng_fn) (void);
 #undef _COREGL_SYMBOL
 
 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST)     RET_TYPE (*ovr_##FUNC_NAME) PARAM_LIST = NULL;
+#define _COREGL_EXT_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST)
 # include "../headers/sym_egl.h"
+#undef _COREGL_EXT_SYMBOL
 #undef _COREGL_SYMBOL
 
 #define INIT_EXPORT()
index 0090ed5..73ed66f 100755 (executable)
@@ -16,7 +16,9 @@
 #undef _COREGL_SYMBOL
 
 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST)     RET_TYPE (*ovr_##FUNC_NAME) PARAM_LIST = NULL;
+#define _COREGL_EXT_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST)
 # include "../headers/sym_gl.h"
+#undef _COREGL_EXT_SYMBOL
 #undef _COREGL_SYMBOL
 
 #define INIT_EXPORT()
@@ -42,7 +44,10 @@ coregl_glwrap_init()
                LOGE("\E[40;31;1mCan't find a symbol '%s'!\E[0m\n\n", #FUNC_NAME); \
                LOGE("\E[40;31;1mInvalid library link! (Check linkage of libGLESv2 -> libCOREGL)\E[0m\n"); \
        }
+
+#define _COREGL_EXT_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST)
 #include "../headers/sym_gl.h"
+#undef _COREGL_EXT_SYMBOL
 #undef _COREGL_SYMBOL
 
        return 1;