[Mesa-dev] [PATCH 3/3] glx: Allow to create any OpenGL ES version.

Jose Fonseca jfonseca at vmware.com
Fri Nov 14 07:56:56 PST 2014


> It looks like you're missing minor_ver checking here? For instance, 2.99 isn't a valid GLES version.

I think these things are already validated on GLX/eGL, but I confess I'm not 100% sure.

Jose


________________________________
From: Daniel Stone <daniel at fooishbar.org>
Sent: 12 November 2014 18:16
To: Jose Fonseca
Cc: mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH 3/3] glx: Allow to create any OpenGL ES version.

Hi,

On 12 November 2014 12:37, <jfonseca at vmware.com<mailto:jfonseca at vmware.com>> wrote:
@@ -544,9 +544,22 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
       case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
         *api = __DRI_API_OPENGL;
         break;
-      case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
-        *api = __DRI_API_GLES2;
-        break;
+      case GLX_CONTEXT_ES_PROFILE_BIT_EXT:
+         switch (*major_ver) {
+         case 3:
+            *api = __DRI_API_GLES3;
+            break;
+         case 2:
+            *api = __DRI_API_GLES2;
+            break;
+         case 1:
+            *api = __DRI_API_GLES;
+            break;
+         default:
+            *error = __DRI_CTX_ERROR_BAD_API;
+            return false;
+         }
+         break;
       default:
         *error = __DRI_CTX_ERROR_BAD_API;
         return false;
@@ -577,19 +590,6 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
       return false;
    }

-   /* The GLX_EXT_create_context_es2_profile spec says:
-    *
-    *     "... If the version requested is 2.0, and the
-    *     GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the
-    *     GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the context
-    *     returned will implement OpenGL ES 2.0. This is the only way in which
-    *     an implementation may request an OpenGL ES 2.0 context."
-    */
-   if (*api == __DRI_API_GLES2 && (*major_ver != 2 || *minor_ver != 0)) {

It looks like you're missing minor_ver checking here? For instance, 2.99 isn't a valid GLES version.

Cheers,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141114/5ae92774/attachment.html>


More information about the mesa-dev mailing list