Revert "i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams."

This reverts commit 3178d2474ae5bdd1102fb3d76a60d1d63c961ff5.

This caused GPU hangs on Ivybridge for some users and huge (80%)
performance regressions across the board on multiple platforms.

We need to find a better solution.  I've made several attempts, but none
of them have worked yet.  In the meantime, we should revert this.

Reverting it breaks GL_PRIMITIVES_GENERATED for non-zero streams, but
that's okay, since we don't expose GL_ARB_gpu_shader5 yet.

Fixes Piglit's EXT_transform_feedback/generatemipmap prims_generated
test case on Haswell.
glsl: Make the tree rebalancer bail on matrix operands.

It doesn't handle things like (vector * matrix) correctly, and
apparently Matt's intention was to bail.

Fixes shader compilation in Natural Selection 2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Guard against error_type in the tree rebalancer.

This helped me track down the bug fixed in the previous commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Make the tree rebalancer use vector_elements, not components().

components() includes matrix columns, so if this code encountered a
matrix, it would ask for something like a vec9 or vec16.  This is
clearly not what you want.

Earlier code now prevents this from seeing matrices, but we should still
use vector_elements, for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: handle a switch where default is in the middle of cases

This fixes following tests in es3conform:

   shaders.switch.default_not_last_dynamic_vertex
   shaders.switch.default_not_last_dynamic_fragment

and makes following tests in Piglit pass:

   glsl-1.30/execution/switch/fs-default-notlast-fallthrough
   glsl-1.30/execution/switch/fs-default_notlast

No Piglit regressions.

v2: take away unnecessary ir_if, just use conditional assignment
v3: use foreach_in_list instead of foreach_list

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v3)
Add the format enums for BPTC-compressed images

This adds the following four Mesa image format enums which correspond to the
four BPTC compressed texture formats:

 MESA_FORMAT_BPTC_RGBA_UNORM
 MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM
 MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT
 MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT

It also updates the format information functions to handle these and the
corresponding GL enums.
Add the GL_ARB_texture_compression_bptc extension

This adds a boolean in the gl_extensions struct for
GL_ARB_texture_compression_bptc as well as an entry in extension_table.
Add a texel fetch function for BPTC-compressed textures

Adds a function to fetch from RGB or SRGB UNORM BPTC-compressed textures. The
function works by decompressing the block surroinding the texel and then
copying the texel out of the decompressed data.

TODO: Add support for the two half-float formats too.
Add a texstore function for BPTC-compressed textures

This adds a compressor for BPTC textures. This compressor works by first
compressing each 4x4 block using the existing DXT3 compressor and then
converting it to a BPTC block. The BPTC block loses one bit of information on
the green component of the endpoints and one bit from the alpha values.

It's probably not really sensible to try to use BPTC compression at runtime
because for example with the Nvidia compression tool it can take in the order
of an hour to compress an full-screen image. With that in mind I don't think
it's worth having a proper compressor in Mesa and this approach gives
reasonable results for a usage that is basically a corner case.
i965: Enable the GL_ARB_texture_compression_bptc extension

Enables the BPTC extension on Gen>=7 and adds the necessary format mappings to
get the right surface type value.
swrast: Enable GL_ARB_texture_compression_bptc

Enables BPTC texture compression on the software rasterizer.