st/mesa: respect higher GLSL levels. (v2)
authorDave Airlie <airlied@redhat.com>
Tue, 22 Oct 2013 08:06:37 +0000 (09:06 +0100)
committerDave Airlie <airlied@gmail.com>
Mon, 25 Nov 2013 03:03:02 +0000 (13:03 +1000)
Limit the max glsl version level to what the state tracker supports.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_extensions.c

index e8d0902d96f44f75d3c911a273226e54adaa21d6..cd10a0c9deabddd4419562361625140110db96c0 100644 (file)
@@ -594,13 +594,9 @@ void st_init_extensions(struct st_context *st)
    /* Figure out GLSL support. */
    glsl_feature_level = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
 
-   if (glsl_feature_level >= 140) {
-      ctx->Const.GLSLVersion = 140;
-   } else if (glsl_feature_level >= 130) {
-      ctx->Const.GLSLVersion = 130;
-   } else {
-      ctx->Const.GLSLVersion = 120;
-   }
+   ctx->Const.GLSLVersion = glsl_feature_level;
+   if (glsl_feature_level >= 330)
+      ctx->Const.GLSLVersion = 330;
 
    _mesa_override_glsl_version(st->ctx);