glsl: Remove unused gl_PerVertex interface blocks.
authorPaul Berry <stereotype441@gmail.com>
Tue, 15 Oct 2013 22:13:59 +0000 (15:13 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 25 Oct 2013 05:01:27 +0000 (22:01 -0700)
commit719bf3016550a279cf0d399b946d0d0b77329927
tree80bb2327a3f375239de12881d804cb287af567cc
parent37d97668ae7e4572c08174a8eee33ca23b9305ea
glsl: Remove unused gl_PerVertex interface blocks.

The GLSL 4.10 rules for redeclaration of built-in interface blocks
(which we've chosen to regard as clarifications of GLSL 1.50) only
require gl_PerVertex blocks to match in shaders that actually use
those blocks.  The easiest way to implement this is to detect
situations where a compiled shader doesn't refer to any elements of
gl_PerVertex, and remove all the associated ir_variables from the
shader at the end of ast-to-ir conversion.

Fixes piglit tests
linker/interstage-{pervertex,pervertex-in,pervertex-out}-redeclaration-unneeded.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ast_to_hir.cpp