Do not use GL_MAJOR_VERSION and GL_MINOR_VERSION at the OpenGL es 2.0 device. 18/257818/2
authorseungho <sbsh.baek@samsung.com>
Mon, 3 May 2021 09:22:29 +0000 (18:22 +0900)
committerseungho <sbsh.baek@samsung.com>
Mon, 3 May 2021 09:34:03 +0000 (18:34 +0900)
Change-Id: Ie3c25e711c2e4de8d7c5d7f4bcd08e2c0182a573
Signed-off-by: seungho <sbsh.baek@samsung.com>
dali/internal/graphics/gles/gl-implementation.h

index bcc8c86..4f3b8dc 100644 (file)
@@ -96,10 +96,14 @@ public:
   {
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
 
-    GLint majorVersion, minorVersion;
-    glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
-    glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
-    mGlesVersion = majorVersion * 10 + minorVersion;
+    // Only change gles version for the device that support above gles 3.0.
+    if(mGlesVersion >= INITIAL_GLES_VERSION)
+    {
+      GLint majorVersion, minorVersion;
+      glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
+      glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
+      mGlesVersion = majorVersion * 10 + minorVersion;
+    }
 
     if(mGlesVersion >= GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED)
     {