glsl: check for forced_language_version in is_version()
authorBrian Paul <brianp@vmware.com>
Wed, 1 Apr 2015 20:36:09 +0000 (14:36 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 8 Apr 2015 23:03:16 +0000 (17:03 -0600)
This is a follow-on fix from the earlier "glsl: allow ForceGLSLVersion
to override #version directives" change.  Since we're not changing
the language_version field, we have to check forced_language_version
here.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/glsl_parser_extras.h

index 1f5478bdf7e4276cbbc5c04a47b8067a864d6f9d..dae7864fdaf3f2f518e4198d1f344a1e77cedfd6 100644 (file)
@@ -105,8 +105,10 @@ struct _mesa_glsl_parse_state {
    {
       unsigned required_version = this->es_shader ?
          required_glsl_es_version : required_glsl_version;
+      unsigned this_version = this->forced_language_version
+         ? this->forced_language_version : this->language_version;
       return required_version != 0
-         && this->language_version >= required_version;
+         && this_version >= required_version;
    }
 
    bool check_version(unsigned required_glsl_version,