summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser.yy
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glsl_parser.yy')
-rw-r--r--src/glsl/glsl_parser.yy20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 920213c3035..5753acf3cd1 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1103,8 +1103,14 @@ layout_qualifier_id_list:
if ($1.flags.q.explicit_location)
$$.location = $1.location;
+ if ($1.flags.q.explicit_index)
+ $$.index = $1.index;
+
if ($3.flags.q.explicit_location)
$$.location = $3.location;
+
+ if ($3.flags.q.explicit_index)
+ $$.index = $3.index;
}
;
@@ -1191,6 +1197,20 @@ layout_qualifier_id:
YYERROR;
}
}
+
+ if (strcmp("index", $1) == 0) {
+ got_one = true;
+
+ $$.flags.q.explicit_index = 1;
+
+ if ($3 >= 0) {
+ $$.index = $3;
+ } else {
+ _mesa_glsl_error(& @3, state,
+ "invalid index %d specified\n", $3);
+ YYERROR;
+ }
+ }
}
/* If the identifier didn't match any known layout identifiers,