r600g/sb: improve optimization of conditional instructions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
r600g/sb: optimize CNDcc instructions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
r600g/sb: improve folding for SETcc

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
st/vdpau: invalidate the handles on destruction

Fixes a problem with xbmc when switching channels.

Signed-off-by: Christian König <christian.koenig@amd.com>
st/vdpau: remove vlCreateHTAB from surface functions

Signed-off-by: Christian König <christian.koenig@amd.com>
st/vdpau: destroy handle table only when it's empty

Signed-off-by: Christian König <christian.koenig@amd.com>
r600g/sb: handle more cases for folding in gvn pass

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
radeonsi: Fix hardware state for dual source blending

Set up CB_SHADER_MASK register according to pixel shader exports, and enable
some minimal state for colour buffer 1 in case dual source blending is used.
radeonsi: Make border colour state handling safe for integer textures
radeonsi: Handle TGSI_SEMANTIC_CLIPDIST
radeonsi: Use tgsi_util_get_texture_coord_dim()
radeonsi: Add support for TGSI TXF opcode
radeonsi: Handle TGSI TXQ opcode
radeonsi: Enable GLSL 1.30
mesa: declare UniformBufferBindings as an array with a static size

Some Gallium drivers were crashing, because the array was not large enough.

v2: clamp the per-shader maximum in st/mesa, then sum them all up

NOTE: This is a candidate for the stable branches.
swrast: increase array size of TextureSample

to match the size of ctx->Texture.Unit, and it will also fix
piglit/max-samplers with the following commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
mesa: fix GLSL program objects with more than 16 samplers combined

The problem is the sampler units are allocated from the same pool for all
shader stages, so if a vertex shader uses 12 samplers (0..11), the fragment
shader samplers start at index 12, leaving only 4 sampler units
for the fragment shader. The main cause is probably the fact that samplers
(texture unit -> sampler unit mapping, etc.) are tracked globally
for an entire program object.

This commit adapts the GLSL linker and core Mesa such that the sampler units
are assigned to sampler uniforms for each shader stage separately
(if a sampler uniform is used in all shader stages, it may occupy a different
sampler unit in each, and vice versa, an i-th sampler unit may refer to
a different sampler uniform in each shader stage), and the sampler-specific
variables are moved from gl_shader_program to gl_shader.

This doesn't require any driver changes, and it fixes piglit/max-samplers
for gallium and classic swrast. It also works with any number of shader
stages.

v2: - converted tabs to spaces
    - added an assertion to _mesa_get_sampler_uniform_value

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>