!UPSTREAM: mesa: Track number of layers in layered framebuffers.

TODO:
- Move earlier
- Use this value (and assertion check it) in blorp stuff
WIP: refactor blorp clearing code in preparation for adding layered clears
i965: Fix blorp clear of layered framebuffers.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-color".
!UPSTREAM: fix meta clear of layered framebuffers

TODO:

- I'm getting an error trying to compile meta shaders because
  gl_PerVertex doesn't match between a 1.10 shader and a 1.50 shader.
  This needs to be fixed first.
Revert "!UPSTREAM: fix meta clear of layered framebuffers"

This reverts commit a40cb3f541f54bb2a22f13222c598d6c01a5afce.
Prohibit illegal mixing of redeclarations inside/outside gl_PerVertex.

From section 7.1 (Built-In Language Variables) of the GLSL 4.10
spec:

    Also, if a built-in interface block is redeclared, no member of
    the built-in declaration can be redeclared outside the block
    redeclaration.

We have been regarding this text as a clarification to the behaviour
established for gl_PerVertex by GLSL 1.50, so we apply it regardless
of GLSL version.

This patch enforces the rule by adding a boolean to ir_variable to
track how the variable was declared: implicitly, normally, or in an
interface block.

Fixes piglit tests:
- gs-redeclares-pervertex-out-after-global-redeclaration.geom
- vs-redeclares-pervertex-out-after-global-redeclaration.vert
- gs-redeclares-pervertex-out-after-other-global-redeclaration.geom
- vs-redeclares-pervertex-out-after-other-global-redeclaration.vert
- gs-redeclares-pervertex-out-before-global-redeclaration
- vs-redeclares-pervertex-out-before-global-redeclaration