Add support for glProgramBinary extension in GLES 2.0 53/29353/1
authorJonghyun Ho <jonghyun.ho@samsung.com>
Tue, 21 Oct 2014 06:16:58 +0000 (15:16 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 24 Oct 2014 16:09:37 +0000 (17:09 +0100)
[problem]     glProgramBinary is disabled at the moment
[cause]       Missing implementation
[solution]    Add support for glProgramBinary extension in GLES 2.0

Change-Id: I1fc798009f9cbc6a933258db2d9209d70dc0fd56
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
adaptors/common/gl/gl-extensions.cpp
adaptors/common/gl/gl-extensions.h
adaptors/common/gl/gl-implementation.h

index a3df146..f02b871 100644 (file)
@@ -57,7 +57,7 @@ void GlExtensions::DiscardFrameBuffer(GLenum target, GLsizei numAttachments, con
     Initialize();
   }
 
-#ifdef PFNGLDISCARDFRAMEBUFFEREXTPROC
+#ifdef GL_EXT_discard_framebuffer
   if( mGlDiscardFramebuffer )
   {
     mGlDiscardFramebuffer(target, numAttachments, attachments);
@@ -78,7 +78,7 @@ void GlExtensions::GetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei
     Initialize();
   }
 
-#ifdef PFNGLGETPROGRAMBINARYOESPROC
+#ifdef GL_OES_get_program_binary
   if (mGlGetProgramBinaryOES)
   {
     mGlGetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
@@ -100,7 +100,7 @@ void GlExtensions::ProgramBinaryOES(GLuint program, GLenum binaryFormat, const G
     Initialize();
   }
 
-#ifdef PFNGLGETPROGRAMBINARYOESPROC
+#ifdef GL_OES_get_program_binary
   if (mGlProgramBinaryOES)
   {
     mGlProgramBinaryOES(program, binaryFormat, binary, length);
@@ -117,15 +117,14 @@ void GlExtensions::Initialize()
 {
   mInitialized = true;
 
-#ifdef PFNGLDISCARDFRAMEBUFFEREXTPROC
+#ifdef GL_EXT_discard_framebuffer
   mGlDiscardFramebuffer = (PFNGLDISCARDFRAMEBUFFEREXTPROC) eglGetProcAddress("glDiscardFramebufferEXT");
 #endif
 
-#ifdef PFNGLGETPROGRAMBINARYOESPROC
+#ifdef GL_OES_get_program_binary
   mGlGetProgramBinaryOES = (PFNGLGETPROGRAMBINARYOESPROC) eglGetProcAddress("glGetProgramBinaryOES");
   mGlProgramBinaryOES = (PFNGLPROGRAMBINARYOESPROC) eglGetProcAddress("glProgramBinaryOES");
 #endif
-
 }
 
 #endif // DALI_GLES_VERSION < 30
index 3fad8df..569a266 100644 (file)
@@ -108,12 +108,11 @@ private:
 
 #if DALI_GLES_VERSION < 30
 
-#ifdef PFNGLDISCARDFRAMEBUFFEREXTPROC
+#ifdef GL_EXT_discard_framebuffer
   PFNGLDISCARDFRAMEBUFFEREXTPROC mGlDiscardFramebuffer;
 #endif
 
-
-#ifdef PFNGLGETPROGRAMBINARYOESPROC
+#ifdef GL_OES_get_program_binary
   PFNGLGETPROGRAMBINARYOESPROC mGlGetProgramBinaryOES;
   PFNGLPROGRAMBINARYOESPROC mGlProgramBinaryOES;
 #endif
index 7c7b802..61704c1 100644 (file)
@@ -1481,6 +1481,8 @@ public:
     // if OpenGL ES 2.0 compatibility is need this can be implemented with
     // glGetProgramBinaryOES
     glGetProgramBinary(program,bufSize,length,binaryFormat,binary);
+#else
+    mGlExtensions.GetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
 #endif // DALI_GLES_VERSION >= 30
   }
 
@@ -1490,6 +1492,8 @@ public:
     // if OpenGL ES 2.0 compatibility is need this can be implemented with
     // glProgramBinaryOES
     glProgramBinary(program,binaryFormat,binary,length);
+#else
+    mGlExtensions.ProgramBinaryOES(program, binaryFormat, binary, length);
 #endif // DALI_GLES_VERSION >= 30
   }