clover: Implement support for the ICD extension.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
clover: Add a pixel_size() method to the image class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
clover: Improve region and pitch argument handling in memory transfer APIs.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
glsl/linker: Allow mixing of desktop GLSL versions.

Previously, Mesa followed the linkage rules outlined in the GLSL
1.20-1.40 specs, which (collectively) said that GLSL versions 1.10 and
1.20 could be linked together, but no other versions could be linked.

In GLSL 4.30, the linkage rules were relaxed so that any two desktop
GLSL versions can be linked together.  This change was made because it
reflected the behaviour of nearly all existing implementations (see
Khronos bug 8463).  Mesa was one of the few (perhaps the only)
exceptions to prohibit cross-linking of some GLSL versions.

Since the GLSL linkage rules were deliberately relaxed in order to
match the behaviour of existing implementations, it seems appropriate
to relax the rules in Mesa too (even though Mesa doesn't support GLSL
4.30 yet).

Note that linking ES and desktop shaders is still prohibited, as is
linking ES shaders having different GLSL versions.

Fixes piglit tests "shaders/version-mixing {interstage,intrastage}".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
gbm-dri: Support importing RGB565 buffers
i965: Drop unused simple_list.h includes.

These don't appear to be necessary.  Everything compiles just fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Implement ARB_texture_mirror_clamp_to_edge.

This passes Piglit's texwrap tests.

v2: Remove _EXT suffix.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Rico Schüller <kgbricola@web.de>
docs: Update docs for ARB_texture_mirror_clamp_to_edge.

Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
docs: Mark GLSL 1.50, 3.30, and geometry shaders done for i965.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glsl: Use saved values instead of recomputing them.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
glsl: Optimize abs(-expr) and abs(abs(expr)) into abs(expr).

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
glsl: Optimize -(-expr) into expr.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
i965/fs: Fix handling of sampler messages with header but zero offset

Gather unconditionally uses a header, but in some cases the
texture_offset value will be zero.

V2: Don't introduce a bogus conversion.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
i965/fs: Fix accidental type conversion in header setup

Previously one side could be UD while the other was float.

V2: Prefer float; apparently IVB can dispatch float ops faster. (Thanks
Eric)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Only emit interpolation setup if there are actual FS inputs.

Dead code elimination would get rid of the extra instructions, but
skipping this saves iterations through the optimization loop.

From shader-db:

      N     Min     Max        Median           Avg        Stddev
x 14672       3      16             3     3.1334515    0.59904168
+ 14672       1      16             3     2.8955153    0.77732963
Difference at 95.0% confidence
        -0.237936 +/- 0.0158798
        -7.59342% +/- 0.506783%
        (Student's t, pooled s = 0.693935)

Embarassingly, the classic shadow mapping shader:

   void main() { }

used to require three iterations through the optimization loop.
With this patch, it only requires one (which makes no progress).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
mesa: remove remnants of GL_MESA_shader_debug

This extension never saw any real use so remove it.

v2: also update tests/num_strings.cpp for 'make check'

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mesa: remove GL_MESA_program_debug bits from gl.h

The code for this was removed from Mesa some time ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mesa: fix a couple issues with U_FIXED, I_FIXED macros

Silence a bunch of MSVC type conversion warnings.

Changed return type of S_FIXED to int32_t (signed).  The result
is the same.  It just seems more intuitive that a signed conversion
function should return a signed value.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
st/dri: minor formatting clean-ups in dri_context.c
st/mesa: minor whitespace, comment changes in st_draw.c