glsl: Don't return bad values from _mesa_shader_type_to_index.

This will avoid compiler warnings in the patch that follows.  There
should be no user-visible effect because the change only affects the
behaviour when an invalid enum is passed to
_mesa_shader_type_to_index(), and that can only happen if there is a
bug elsewhere in Mesa.
main: Move MESA_SHADER_TYPES outside of gl_shader_type enum.

This will avoid spurious compiler warnings in the patch that follows.
glsl: Replace _mesa_glsl_parser_targets enum with gl_shader_type.

These enums were redundant.
main: Remove unused function _mesa_shader_index_to_type().
glsl: Get rid of hardcoded arrays of shader target names.

We already have a function for converting a shader type index to a
string: _mesa_glsl_shader_target_name().
glsl: Remove extraneous shader_type argument from analyze_clip_usage().

This argument was carrying the name of the shader target (as a
string).  We can get this just as easily by calling
_mesa_glsl_shader_target_name().
mesa: Improve static error checking of arrays sized by MESA_SHADER_TYPES.

This patch replaces the following pattern:

    foo bar[MESA_SHADER_TYPES] = {
       ...
    };

With:

    foo bar[] = {
       ...
    };
    STATIC_ASSERT(Elements(bar) == MESA_SHADER_TYPES);

This way, when a new shader type is added in a future version of Mesa,
we will get a compile error to remind us that the array needs to be
updated.
mesa: Add an assertion to _mesa_program_index_to_target().

Only a Mesa bug could cause this function to be called with an
out-of-range index, so raise an assertion if that ever happens.
glsl: Fix gl_type of usamplerCube built-in type.

I'm not aware of any piglit tests that this fixes, but the old code
was obviously wrong.
!UPSTREAM: i965/gs: Generalize some error messages for GS.

TODO: find more places to generalize.
TODO: Don't use "VS/GS" terminology.  Use "vec4" terminology, since that will endure longer.
!UPSTREAM: glsl/linker: Fail if linking geometry shader with 0 GEOMETRY_VERTICES_OUT.

ARB_geometry_shader4 spec 2.15.2:
"Linking will also fail [...] if the program object contains objects to form a
geometry shader, and the value of GEOMETRY_VERTICES_OUT_ARB is zero."

Reviewed-by: Paul Berry <stereotype441@gmail.com>

TODO: May not be necessary for GLSL 1.50 style geometry shaders.  Make a test to validate.
!UPSTREAM: Work around bug in AntTweakBar

AntTweakBar tries to use glGetString(GL_EXTENSIONS) when connected to
a core context (it should use glGetStringi()).  Go ahead and allow
this for the time being.
!UPSTREAM: main: check texture target when validating layered framebuffers.

From section 4.4.4 (Framebuffer Completeness) of the GL 3.2 spec:

    If any framebuffer attachment is layered, all populated
    attachments must be layered. Additionally, all populated color
    attachments must be from textures of the same target.

We weren't checking that the attachments were from textures of the
same target.

TODO:
- Make a piglit test for this, and validate it on Nvidia.
Rename overloads of _mesa_glsl_shader_target_name().

Previously, _mesa_glsl_shader_target_name() had an overload for GLenum
and an overload for the gl_shader_type enum, each of which behaved
differently.  However, since GLenum is a synonym for unsigned int, and
unsigned ints are often used in place of gl_shader_type (e.g. in loop
indices), there was a big risk of calling the wrong overloda by
mistake.  This patch gives the two overloads different names so that
it's always clear which one we mean to call.