glsl: Allow layout qualifiers in GLSL 3.00 ES
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 9 Nov 2012 20:26:42 +0000 (12:26 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 6 Dec 2012 20:13:22 +0000 (12:13 -0800)
Note that while 'packed' is a reserved word in GLSL ES, row_major is not.
This means that we have to use the string-based matching for that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
src/glsl/glsl_lexer.ll
src/glsl/glsl_parser.yy
src/glsl/glsl_parser_extras.cpp

index af39512ed153169ac18dd6ac6ce0cfefc974b545..2f66c5828a8707ebc35f3be8f5dd387a8e053dda 100644 (file)
@@ -437,7 +437,7 @@ enum                KEYWORD(110, 100, 0, 0, ENUM);
 typedef                KEYWORD(110, 100, 0, 0, TYPEDEF);
 template       KEYWORD(110, 100, 0, 0, TEMPLATE);
 this           KEYWORD(110, 100, 0, 0, THIS);
-packed         KEYWORD_WITH_ALT(110, 100, 140, 0, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK);
+packed         KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK);
 goto           KEYWORD(110, 100, 0, 0, GOTO);
 switch         KEYWORD(110, 100, 130, 300, SWITCH);
 default                KEYWORD(110, 100, 130, 300, DEFAULT);
index d938765d750d7860ccf357cfd0640bcd01a451f6..f12336883483147ffbd1061b43bab4a4b4d2a3e6 100644 (file)
@@ -1143,6 +1143,8 @@ layout_qualifier_id:
                 $$.flags.q.shared = 1;
              } else if (strcmp($1, "column_major") == 0) {
                 $$.flags.q.column_major = 1;
+             } else if (strcmp($1, "row_major") == 0) {
+                $$.flags.q.row_major = 1;
              }
 
              if ($$.flags.i && state->ARB_uniform_buffer_object_warn) {
index 1cf4571e5a9e869fa5ff04665004fcf7f7df46a5..d36089226f1eb3c2b5f029dbfc9eff5dae7d9287 100644 (file)
@@ -279,6 +279,10 @@ _mesa_glsl_parse_state::process_version_directive(YYLTYPE *locp, int version,
    if (this->language_version >= 140) {
       this->ARB_uniform_buffer_object_enable = true;
    }
+
+   if (this->language_version == 300 && this->es_shader) {
+      this->ARB_explicit_attrib_location_enable = true;
+   }
 }
 
 const char *