diff options
author | Ilia Mirkin <[email protected]> | 2015-04-27 14:00:44 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-04-27 16:03:16 -0400 |
commit | dfb0b36e8ff93873920495647381b3faf30df028 (patch) | |
tree | 3535facc23a6e5f8071a141761d309b4729a1769 /src/mesa/main/version.c | |
parent | 7c3d1c132eea83fb257cbc473a8a79638ddc3014 (diff) |
mesa: fix up GLSL version when computing GL version
In some situations it is convenient for a driver to expose a higher GLSL
version while some extensions are still incomplete. However in that
situation, it would report a GLSL version that was higher than the GL
version. Avoid that situation by limiting the GLSL version to the GL
version.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/version.c')
-rw-r--r-- | src/mesa/main/version.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index a65ace04295..5b8ac0a5c5c 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -483,6 +483,23 @@ _mesa_compute_version(struct gl_context *ctx) ctx->Version = _mesa_get_version(&ctx->Extensions, &ctx->Const, ctx->API); + /* 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) { + switch (ctx->Version) { + case 31: + ctx->Const.GLSLVersion = 140; + break; + case 32: + ctx->Const.GLSLVersion = 150; + break; + default: + ctx->Const.GLSLVersion = ctx->Version * 10; + break; + } + } + switch (ctx->API) { case API_OPENGL_COMPAT: case API_OPENGL_CORE: |