glsl: implement switch flow control using a loop

Patch removes old variable based logic for handling a break inside
switch. Switch is put inside a loop so that existing infrastructure
for loop flow control can be used for the switch, now also dead code
elimination works properly.

Possible 'continue' call inside a switch needs now special handling
which is taken care of by detecting continue, breaking out and calling
continue for the outside loop.

v2: remove one unnecessary ir_expression (Curro)

Fixes following Piglit tests:

   fs-exec-after-break.shader_test
   fs-conditional-break.shader_test

No Piglit or es3conform regressions.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
clover/util: Fix construction of compat::vector with a general container as argument.
clover/util: Define equality operators for a couple of compat classes.
clover/util: Allow using key_equals with pair-like objects other than std::pair.
clover: Add a simple compat::pair.

std::pair is not c++98/c++11 safe.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
clover: Add initial implementation of clCompileProgram for CL 1.2.

[ Francisco Jerez: General clean-up. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
clover: Add allow_empty_tag.

To allow empty objs() list checks.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
clover: Don't return CL_INVALID_VALUE if there is no header.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
mesa: validate sampler uniforms during gluniform calls

Patch fixes 'glsl-2types-of-textures-on-same-unit' in WebGL conformance
test suite. No Piglit regressions, fixes gl-2.0-active-sampler-conflict.

To avoid adding potentially heavy check during draw (valid_to_render),
check is done during uniform updates by inspecting TexturesUsed mask.

A new boolean variable is introduced to cache validation state.

v2: take into account case where 2 uniforms use same unit (curro)
    also do the check only when SSO is not in use, SSO has own
    path for sampler validation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
tgsi/ureg: add ureg_UARL shortcut

We use it in Gallium Nine code.
mesa/gallium: API settings / rasterization rules

D3D9 has different system coordinate, add neccessary infrastructure for it.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/drivers: use API settings / rasterization rules

This commit allow drivers use new added infrastructure.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
winsys/sw/wrapper: hook up is_displaytarget_format_supported

Gallium Nine make use of it, because we wrapping around sw screen.
gallium/auxiliary: implement sw_probe_wrapped

This is useful for resource sharing.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/draw: support hack to disable clipping (v2)

v2: drop ifdef change, which may be send later in separate commit
gallium/auxiliary: Prefer intrinsics to handrolled atomic ops for Linux (v2)

v2: prefer intrinsics only on Linux to avoid compilation problems
    on other platforms [1].

We need this patch, because Gallium Nine use directly intrinsics.
Otherwise build fails.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=30514

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
configure: add configurable pipe-driver location

This option gives better flexibility when using gallium pipe drivers.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/auxiliary: add inc and dec alternative with return

They're useful for Gallium Nine.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/auxiliary: add contained and rect checks (v2)

v2: thanks to Bruno Jimenez, fixed for() in u_box_clip_3d

For D3D9 is very important have handled intersections and covers.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/auxiliary: add dump functions for Nine

For debugging purposes of Gallium Nine.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>