glsl/cs: Change some linker loops to use MESA_SHADER_FRAGMENT as a bound.

Linker loops that iterate through all the stages in the pipeline need
to use MESA_SHADER_FRAGMENT as a bound, so that we can add an
additional MESA_SHADER_COMPUTE stage, without it being erroneously
included in the pipeline.
glsl/linker: Refactor in preparation for adding more shader stages.

Rather than maintain separately named arrays and counts for vertex,
geometry, and fragment shaders, just maintain these as arrays indexed
by the gl_shader_type enum.
mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.

These are replaced with
ctx->Shader.CurrentProgram[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}].
In patches to follow, this will allow us to replace a lot of ad-hoc
logic with a variable index into the array.

With the exception of the changes to mtypes.h, this patch was
generated entirely by the command:

    find src -type f '(' -iname '*.c' -o -iname '*.cpp' ')' \
    -print0 | xargs -0 sed -i \
    -e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \
    -e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \
    -e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g'
mesa: Fold long lines introduced by the previous patch.
i965: Fix comments to refer to the new ctx->Shader.CurrentProgram array.
meta: Replace save_state::{Vertex,Geometry,Fragment}Shader with an array.

Since ctx->Shader.Current{Vertex,Geometry,Fragment}Program is an
array, this allows some meta code to be rolled up into loops.
mesa: Remove ad-hoc arrays of gl_shader_program.

Now that we have a ctx->Shader.CurrentProgram array, we can just use
it directly.
mesa: Change redundant code into loops in shaderapi.c.

This is possible now that ctx->Shader.CurrentProgram is an array.
mesa: Change redundant code into loops in texstate.c

This is possible now that ctx->Shader.CurrentProgram is an array.
mesa/cs: Add extension enable flags for ARB_compute_shader.
mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_SIZE constant.
mesa/cs: Add dispatch API stubs for ARB_compute_shader.
mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant.
!UPSTREAM: glsl/cs: Add parser support for compute shader layout qualifiers.

TODO:
- Does this need to be merged with later patches?
!UPSTREAM: mesa/cs: Add a MESA_SHADER_COMPUTE stage.

TODO:
- Document this better
- Merge with later switch statement fixes
- Clean up warnings
i965/cs: Allow ARB_compute_shader to be enabled via env var.

This will allow testing of compute shader functionality before it is
completed.
glsl/cs: Handle compute shader local_size_{x,y,z} declaration.
!UPSTREAM: WIP: update switch statements etc

TODO:
- Merge with an earlier patch.
WIP: glsl/cs: implement generate_cs_special_vars()
mesa/cs: Create the gl_compute_program struct, and the code to initialize it.