glsl: Use has_layout() rather than a partial open coded version.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 16 Jul 2013 18:39:01 +0000 (11:39 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jul 2013 23:57:23 +0000 (16:57 -0700)
commit56bcde34b2d3451d81878da17cacccf4d9bba5bc
tree48a7ab60a56dc26b0a7597dd4eaf4473a28d7347
parentc397ec94e9a54521a873e84867268c40c73db79c
glsl: Use has_layout() rather than a partial open coded version.

The idea of this code is to disallow layout(...) sections with the
deprecated "varying" or "attribute" keywords, unless a few select
extensions are enabled which allow a more relaxed check.

In order to detect a layout(...) section, the code checks for a number
of layout qualifiers.  However, it failed to check for all of them,
which could lead to layout(...) not being detected when it should.

By replacing this with has_layout(), we properly check for all layout
qualifiers, and also guarantees that new qualifiers added in the future
will not be forgotten.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ast_to_hir.cpp