aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/drivers/dri')
-rw-r--r--mesalib/src/mesa/drivers/dri/common/drisw_util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/drisw_util.c b/mesalib/src/mesa/drivers/dri/common/drisw_util.c
index e22ae1b84..33339880b 100644
--- a/mesalib/src/mesa/drivers/dri/common/drisw_util.c
+++ b/mesalib/src/mesa/drivers/dri/common/drisw_util.c
@@ -127,7 +127,10 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
mesa_api = API_OPENGLES2;
break;
case __DRI_API_OPENGL_CORE:
+ mesa_api = API_OPENGL_CORE;
+ break;
default:
+ *error = __DRI_CTX_ERROR_BAD_API;
return NULL;
}
@@ -150,6 +153,19 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
}
}
+ /* Mesa does not support the GL_ARB_compatibilty extension or the
+ * compatibility profile. This means that we treat a API_OPENGL_COMPAT 3.1 as
+ * API_OPENGL_CORE and reject API_OPENGL_COMPAT 3.2+.
+ */
+ if (mesa_api == API_OPENGL_COMPAT && major_version == 3 && minor_version == 1)
+ mesa_api = API_OPENGL_CORE;
+
+ if (mesa_api == API_OPENGL_COMPAT
+ && ((major_version > 3)
+ || (major_version == 3 && minor_version >= 2))) {
+ *error = __DRI_CTX_ERROR_BAD_API;
+ return NULL;
+ }
/* There are no forward-compatible contexts before OpenGL 3.0. The
* GLX_ARB_create_context spec says:
*