diff options
-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 a65ace0429..5b8ac0a5c5 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: |