From d6e84ce9b5f44c582b3e4b367606e8dbf1aa469b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 30 Apr 2014 10:56:59 +0300 Subject: [PATCH] glsl: fix bogus layout qualifier warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print out GL_ARB_explicit_attrib_location warnings only when parsing attribute that uses "location" qualifier. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77245 Signed-off-by: Tapani Pälli --- src/glsl/glsl_parser.yy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 2d0e7be..e506d07 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1319,6 +1319,13 @@ layout_qualifier_id: if (match_layout_qualifier("location", $1, state) == 0) { $$.flags.q.explicit_location = 1; + if ($$.flags.q.attribute == 1 && + state->ARB_explicit_attrib_location_warn) { + _mesa_glsl_warning(& @1, state, + "GL_ARB_explicit_attrib_location layout " + "identifier `%s' used", $1); + } + if ($3 >= 0) { $$.location = $3; } else { @@ -1426,10 +1433,6 @@ layout_qualifier_id: _mesa_glsl_error(& @1, state, "unrecognized layout identifier " "`%s'", $1); YYERROR; - } else if (state->ARB_explicit_attrib_location_warn) { - _mesa_glsl_warning(& @1, state, - "GL_ARB_explicit_attrib_location layout " - "identifier `%s' used", $1); } } | interface_block_layout_qualifier -- 1.9.0