---
 src/mesa/main/version.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 1bdccf4a1df..0d2597a61f4 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -228,6 +228,7 @@ _mesa_override_glsl_version(struct gl_constants *consts)
    }
 
    n = sscanf(version, "%u", &consts->GLSLVersion);
+   consts->GLSLVersionCompat = consts->GLSLVersion;
    if (n != 1) {
       fprintf(stderr, "error: invalid value for %s: %s\n", env_var, version);
       return;
@@ -624,16 +625,21 @@ _mesa_compute_version(struct gl_context *ctx)
       switch (ctx->Version) {
       case 30:
          ctx->Const.GLSLVersion = 130;
+         ctx->Const.GLSLVersionCompat = 130;
          break;
       case 31:
          ctx->Const.GLSLVersion = 140;
+         ctx->Const.GLSLVersionCompat = 140;
          break;
       case 32:
          ctx->Const.GLSLVersion = 150;
+         ctx->Const.GLSLVersionCompat = 150;
          break;
       default:
-         if (ctx->Version >= 33)
+         if (ctx->Version >= 33) {
             ctx->Const.GLSLVersion = ctx->Version * 10;
+            ctx->Const.GLSLVersionCompat = ctx->Version * 10;
+         }
          break;
       }
    }
-- 
2.17.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to