# OpenGL Core and Compatibility context support
-OpenGL 3.1 and later versions are only supported with the Core profile.
-There are no plans to support GL_ARB_compatibility. The last supported OpenGL
-version with all deprecated features is 3.0. Some of the later GL features
-are exposed in the 3.0 context as extensions.
+Some drivers do not support the Compatibility profile or ARB_compatibility.
+Such drivers are limited to OpenGL 3.0 if the Core profile is not requested
+by applications. Some of the later GL features are exposed in the 3.0 context
+as extensions.
Feature Status
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
-4.5 is <strong>only</strong> available if requested at context creation
-because compatibility contexts are not supported.
+4.5 is <strong>only</strong> available if requested at context creation.
+Compatibility contexts may report a lower version depending on each driver.
</p>
</p>
<ul>
+<li>OpenGL 3.1 with ARB_compatibility on nv50, nvc0, r600, radeonsi, softpipe, llvmpipe, svga</li>
<li>GL_ARB_bindless_texture on nvc0/maxwell+</li>
<li>GL_EXT_semaphore on radeonsi</li>
<li>GL_EXT_semaphore_fd on radeonsi</li>
}
}
- /* 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 &&
- ctx_config.major_version == 3 && ctx_config.minor_version == 1)
- mesa_api = API_OPENGL_CORE;
-
if (mesa_api == API_OPENGL_COMPAT
&& ((ctx_config.major_version > 3)
|| (ctx_config.major_version == 3 &&
{
switch (api) {
case API_OPENGL_COMPAT:
- /* Disable GLSL 1.40 and later for legacy contexts.
- * This disallows creation of the GL 3.1 compatibility context. */
+ /* Disable higher GLSL versions for legacy contexts.
+ * This disallows creation of higher compatibility contexts. */
if (!consts->AllowHigherCompatVersion) {
- if (consts->GLSLVersion > 130) {
- consts->GLSLVersion = 130;
+ if (consts->GLSLVersion > 140) {
+ consts->GLSLVersion = 140;
}
}
/* fall through */
_mesa_compute_version(struct gl_context *ctx)
{
if (ctx->Version)
- return;
+ goto done;
ctx->Version = _mesa_get_version(&ctx->Extensions, &ctx->Const, ctx->API);
ctx->Extensions.Version = ctx->Version;
/* Make sure that the GLSL version lines up with the GL version. In some
* cases it can be too high, e.g. if an extension is missing.
*/
- if (ctx->API == API_OPENGL_CORE) {
+ if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 31) {
switch (ctx->Version) {
case 31:
ctx->Const.GLSLVersion = 140;
create_version_string(ctx, "OpenGL ES ");
break;
}
+
+done:
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Version >= 31)
+ ctx->Extensions.ARB_compatibility = GL_TRUE;
}