glsl: Prohibit structs and bools from being used as "varyings".
glsl: Prohibit structs and bools from being used as "varyings".

The GLSL 1.30 spec only allows vertex shader outputs and fragment
shader inputs ("varyings" in pre-GLSL-1.30 parlance) to be of type
int, uint, float, or vectors, matrices, or arrays thereof.  Bools,
bvec's, and structs are prohibited.  (Integral varyings were
prohibited prior to GLSL 1.30).

Previously, Mesa only performed this check on variables declared with
the "varying" keyword, and it always performed the check according to
the pre-GLSL-1.30 rules.  As a result, bools and structs were allowed
to slip through, provided they were declared using the new in/out
syntax.

This patch modifies the error check so that it occurs after "varying"
is converted to "in/out", and corrects it to properly account for GLSL
version.

Fixes piglit tests:
  in-bool-prohibited.frag
  in-bvec2-prohibited.frag
  in-bvec3-prohibited.frag
  in-bvec4-prohibited.frag
  in-struct-prohibited.frag
  out-bool-prohibited.vert
  out-bvec2-prohibited.vert
  out-bvec3-prohibited.vert
  out-bvec4-prohibited.vert
  out-struct-prohibited.vert

Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>

zeux/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,mcanthony/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,wolf96/glsl-optimizer,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer