egl: Expose EGL_KHR_get_all_proc_addresses and its client extension

Mesa already implements the behavior of EGL_KHR_get_all_proc_addresses
and EGL_KHR_client_get_all_proc_addresses. This patch just exposes the
extension strings.

See: https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_get_all_proc_addresses.txt
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
i965: Add opcode names for set_omask and set_sample_id.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
i965: Add missing opcode names.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: Remove default from brw_instruction_name switch to catch missing names.

The case-range extension is available in clang and gcc at least back to
3.4.0.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
loader: Add missing EXPAT_CFLAGS to libloader.la CPPFLAGS

Reviewed-by: Matt Turner <mattst88@gmail.com>
ir_to_mesa: Remove sat to clamp lowering pass

Fixes an infinite loop in swrast where the lowering pass unpacks saturate into
clamp but the opt_algebraic pass tries to do the opposite.

v3 (Ian):
This is a revert of commit cfa8c1cb "ir_to_mesa: lower ir_unop_saturate" on
the ir_to_mesa.cpp portion. prog_execute.c can handle saturates in vertex
shaders, so classic swrast shouldn't need this lowering pass.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83463
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
glsl: Don't optimize min/max into saturate when EmitNoSat is set

v3: Fix multi-line comment format (Ian)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
st/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported

There is a bug in the current lowering pass implementation where we lower saturate
to clamp only for vertex shaders on drivers supporting SM 3.0. The correct behavior
is to actually lower to clamp only when we don't support saturate which happens
on drivers that don't support SM 3.0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
st/nine: NineBaseTexture9: fix setting of last_layer

last_layer should be only non-null for cubetexture for Nine.
There was probably a confusion for 3D textures, but those
need last_layer=0 as well.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: CubeTexture: fix GetLevelDesc

This->surfaces contains the surfaces associated to the levels
and faces. This->surfaces[6*Level] is what we want here,
since it gives us a face descriptor for the level 'Level'.

Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: NineBaseTexture9: update sampler view creation

While previous code was having the correct behaviour in general,
this new code is more readable (without checking all gallium formats
manually) and has a more defined behaviour for depth stencil resources.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: fix crash when deleting non-implicit swapchain

Fixed problems with battle.net launcher.

Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: clamp color inputs for ps <= 2.0

Nine code is clamping color outputs for vs < 3,
but msdn docs says it is done in the ps.
Wine seems to clamp them at the vs level.

To prevent potential issues, just clamp at both vs
and ps level.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: saturate oFog and oPts vs outputs

According to docs and Wine, these two vs outputs have
to be saturated.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Fix POW implementation

POW doesn't match directly TGSI, since we should
take the absolute value of src0.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Handle RSQ special cases

We should use the absolute value of the input
as input to ureg_RSQ.
An input of 0.0 should return FLT_MAX. To support that
efficiently cap the output of RSQ.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Handle NRM with input of null norm

When the input's xyz are 0.0, the output
should be 0.0. This is due to the fact that
Inf * 0 = 0 for dx9. To handle this case,
cap the result of RSQ to FLT_MAX. We have
FLT_MAX * 0 = 0.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Correct LOG on negative values

LOG, like POW, is applicated on the absolute value of the input.

Also return -FLT_MAX instead of -Inf for an input of 0.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Remove duplicated code for ps texcoord input declaration

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Implement TEXCOORD special behaviours

texcoord for ps < 1_4 should clamp between 0 and 1 the values.

texcrd (texcoord ps 1_4) does not clamp and can be used with
two modifiers _dw and _dz that means the channels are divided
by w or z.
Implement those in shared code, since the same modifiers can be used
for texld ps 1_4.

Signed-off-by: Axel Davy <axel.davy@ens.fr>