mesa/dri: Allow creation of forward-compatible contexts
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 17 Aug 2012 16:23:50 +0000 (09:23 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Aug 2012 22:09:37 +0000 (15:09 -0700)
This is done by changing the API to API_OPENGL_CORE.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/common/dri_util.c

index 86409dd068967a1cfbb86c4abc10f6fe9a21ec87..4276ad981f91f6a5ab896abaa0f7499e4731d50d 100644 (file)
@@ -257,17 +257,17 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
      *     "Forward-compatible contexts are defined only for OpenGL versions
      *     3.0 and later."
      *
-     * Moreover, Mesa can't fulfill the requirements of a forward-looking
-     * context.  Return failure if a forward-looking context is requested.
+     * Forward-looking contexts are supported by silently converting the
+     * requested API to API_OPENGL_CORE.
      *
      * In Mesa, a debug context is the same as a regular context.
      */
     if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0) {
-       *error = __DRI_CTX_ERROR_BAD_FLAG;
-       return NULL;
+       mesa_api = API_OPENGL_CORE;
     }
 
-    if ((flags & ~__DRI_CTX_FLAG_DEBUG) != 0) {
+    if ((flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_FORWARD_COMPATIBLE))
+        != 0) {
        *error = __DRI_CTX_ERROR_UNKNOWN_FLAG;
        return NULL;
     }