i965: Remove unused depth_mode parameter from translate_tex_format().

According to git blame, this hasn't been used in over two years:

    commit d2235b0f4681f75d562131d655a6d7b7033d2d8b
    Author: Eric Anholt <eric@anholt.net>
    Date:   Thu Nov 17 17:01:58 2011 -0800

        i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Revert "mesa: Remove GLXContextID typedef from glx.h."

This reverts commit 136a12ac98868d82c2ae9fcc80d11044a7ec56d1.

According to belak51 on IRC, this commit broke Allegro, which would no
longer compile.  Applications apparently expect the GLXContextID typedef
to exist in glx.h; removing it breaks them.  A bit of searching around
the internet revealed other complaints since upgrading to Mesa 10.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
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 overload by
mistake.  This patch gives the two overloads different names so that
it's always clear which one we mean to call.

Reviewed-by: Brian Paul <brianp@vmware.com>
main: Remove unused function _mesa_shader_index_to_type().

Reviewed-by: Brian Paul <brianp@vmware.com>
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_shader_type_to_string().

Reviewed-by: Brian Paul <brianp@vmware.com>
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_shader_enum_to_string().

Reviewed-by: Brian Paul <brianp@vmware.com>
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.

Reviewed-by: Brian Paul <brianp@vmware.com>
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.

Reviewed-by: Brian Paul <brianp@vmware.com>
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.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Add XRGB to intel_texsubimage_tiled_memcpy()

MESA_FORMAT_XRGB8888 is equivalent to MESA_FORMAT_ARGB8888 in terms
of storage on the device, so okay to use this optimized copy routine.

This series builds on work from Frank Henigman to optimize the
process of uploading a texture to the GPU. This series adds support for
MESA_XRGB_8888 and full miptrees where were found to be common activities
in the Smokin' Guns game. The issue was found while profiling the app
but that part is not benchmarked. Smokin-Guns uses mipmap textures with
an internal format of GL_RGB (MESA_XRGB_8888 in the driver).

These changes need a performance tool to run against to show how they
improve execution performance for specific texture formats. Using this
benchmark I've measured the following improvement on my Ivybridge
Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz.

1024x1024 texture size
internal-format	Before (MB/sec)     XRGB (MB/sec)
GL_RGBA		628.15		    627.15
GL_RGB		265.95	 	    456.35

512x512 texture size
internal-format	Before (MB/sec)     XRGB (MB/sec)
GL_RGBA		600.23	  	    597.00
GL_RGB		255.50		    440.62

256x256 texture size
internal-format	Before (MB/sec)     XRGB (MB/sec)
GL_RGBA		489.08		    487.80
GL_RGB		229.03	  	    376.63

Benchmark has been sent to mesa-dev list: teximage

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
i965: Enhance intel_texsubimage_tiled_memcpy() to support all levels

Support all levels of a supported texture format.

Using 1024x1024, RGBA 8888 source, mipmap
internal-format	Before (MB/sec)     mipmap (MB/sec)
GL_RGBA		627.15		615.90
GL_RGB		456.35		611.53

512x512
GL_RGBA		597.00		619.95
GL_RGB		440.62		611.28

256x256
GL_RGBA		487.80		587.42
GL_RGB		376.63		585.00

Benchmark has been sent to mesa-dev list: teximage_enh

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>