aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/dri/common/dri_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/drivers/dri/common/dri_util.c')
-rw-r--r--mesalib/src/mesa/drivers/dri/common/dri_util.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c
index 91ae186fe..86409dd06 100644
--- a/mesalib/src/mesa/drivers/dri/common/dri_util.c
+++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c
@@ -192,6 +192,8 @@ dri2CreateContextAttribs(__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;
@@ -218,6 +220,20 @@ dri2CreateContextAttribs(__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 3.1 as
+ * API_OPENGL_CORE and reject API_OPENGL 3.2+.
+ */
+ if (mesa_api == API_OPENGL && major_version == 3 && minor_version == 1)
+ mesa_api = API_OPENGL_CORE;
+
+ if (mesa_api == API_OPENGL
+ && ((major_version > 3)
+ || (major_version == 3 && minor_version >= 2))) {
+ *error = __DRI_CTX_ERROR_BAD_API;
+ return NULL;
+ }
+
/* The EGL_KHR_create_context spec says:
*
* "Flags are only defined for OpenGL context creation, and specifying
@@ -228,8 +244,8 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
* anything specific about this case. However, none of the known flags
* have any meaning in an ES context, so this seems safe.
*/
- if (mesa_api != __DRI_API_OPENGL
- && mesa_api != __DRI_API_OPENGL_CORE
+ if (mesa_api != API_OPENGL
+ && mesa_api != API_OPENGL_CORE
&& flags != 0) {
*error = __DRI_CTX_ERROR_BAD_FLAG;
return NULL;