diff options
author | Marek Olšák <[email protected]> | 2018-02-14 20:13:40 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-02-23 20:50:17 +0100 |
commit | a0c8b49284efe736849c0a45920ad0a1bbd8d93d (patch) | |
tree | af55b4777c74d150b29eca4af9fb849bdc8bd286 /src/mesa | |
parent | 605a7f6db51cb946eed508bc9a7adfa753c75e10 (diff) |
mesa: enable OpenGL 3.1 with ARB_compatibility
Tested-by: Dieter Nützel <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 8 | ||||
-rw-r--r-- | src/mesa/main/version.c | 16 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e6a7d2391a7..a34f38d6114 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -381,14 +381,6 @@ 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 && - 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 && diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index d26baab8209..a28069054d3 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -580,11 +580,11 @@ _mesa_get_version(const struct gl_extensions *extensions, { 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 */ @@ -607,7 +607,7 @@ void _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; @@ -615,7 +615,7 @@ _mesa_compute_version(struct gl_context *ctx) /* 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; @@ -651,6 +651,10 @@ _mesa_compute_version(struct gl_context *ctx) create_version_string(ctx, "OpenGL ES "); break; } + +done: + if (ctx->API == API_OPENGL_COMPAT && ctx->Version >= 31) + ctx->Extensions.ARB_compatibility = GL_TRUE; } |