glsl: Only allow `invariant` on shader in/out between stages.
authorChris Forbes <chrisf@ijw.co.nz>
Mon, 21 Apr 2014 03:45:32 +0000 (15:45 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 21 Apr 2014 21:07:05 +0000 (09:07 +1200)
commit0dfa6e7cf5a1f5207b32140f48cd3870db8a189b
tree071d838554b96d301d22aa95abc2c5e9f314357b
parent0a0075666c7132cf284769802332017db42d42ed
glsl: Only allow `invariant` on shader in/out between stages.

Previously this was special-cased for VS and FS; it never got updated
when geometry shaders came along. Generalize using is_varying_var() so
this won't be broken again with tessellation.

Note that there are two copies of the logic for `invariant`: It can be
present as part of a new declaration, and also as a redeclaration of an
existing variable or block member.

Fixes the four new piglits:
   spec/glsl-1.50/compiler/invariant-qualifier-*.geom

Note for stable: This won't quite pick cleanly due to whitespace and
state->target -> state->stage renames. Should be straightforward
adjustments though.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp