gallivm: Fix mask calculation for emit_kill_if.

The exec_mask must be taken in consideration, just like emit_kill above.

The tgsi_exec module has the same bug and should be fixed in a future
change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
st/mesa: fix GL_FEEDBACK mode inverted Y coordinate bug

We need to check the drawbuffer's orientation before inverting Y
coordinates.  Fixes piglit feedback tests when running with the
-fbo option.

Cc: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
u_gen_mipmap: Use untampered cubemap texture coords when generating mipmaps.

It's not necessary to scale down cubemap texture coords when generating
mipmaps: we are doing a 2x minification therefore it's guaranteed that
the texture coords will always be at least 1 texel away of the edges.

Scaling down can actually be harmful, as it may cause artefacts when
generating mipmaps with nearest filtering.  Sample points will lie
exactly in the middle each 2x2 texels, so the scaling factor was causing
different texels to be take on each quadrant of the cube face.  This is
apparent with a 1x1 checkerboard pattern in the base mipmap level:
instead of next mipmap level receiving a constant color throughout the
face, it will have different colors for each quadrant of the face.

The behaviour for blits is left untouched for now, but the cubemap
texture coord scaling hack should be reconsidered eventually.

Reviewed-by: Brian Paul <brianp@vmware.com>
i965/fs: Use source's original type in register_coalesce().

Previously, register_coalesce() would modify

   mov   vgrf1:f  vgrf2:f
   cmp   null     vgrf3:d  vgrf1:d

to be

   cmp   null     vgrf3:d  vgrf2:f

and incorrectly use vgrf2's type in the instruction that the mov was
coalesced into.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Fix disassembled names of BFI1 and BFI2 instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Emit compressed 3-source instructions on Haswell.

For commit 4df56177 Paul discovered that the hardware restriction that
Align16 instructions cannot be compressed was lifted on Haswell. This
has prevented us from emitting compressed three-source instructions.

For added confirmation, the bspec lists a work around called
WaBreakSimd16TernaryInstructionsIntoSimd8 that hasn't been applicable
since very early Haswell silicon.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Don't emit SIMD16 BFI instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/vec4: Add invalidate_live_intervals method.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Make invalidate_live_intervals() a virtual method of backend_visitor.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Add a pass to remove dead control flow.

Removes IF/ENDIF and IF/ELSE/ENDIF with no intervening instructions.

total instructions in shared programs: 1360393 -> 1360387 (-0.00%)
instructions in affected programs:     157 -> 151 (-3.82%)

(no change in vertex shaders)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Link -ldl after libmesa.la

DLOPEN_LIBS is part of DRI_LIB_DEPS.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71512
Reviewed-by: Eric Anholt <eric@anholt.net>
i965/test: Use unreachable() to silence warning.
mesa: Fix setup of LocalParams array.

i965 passed piglit, but swrast and gallium both segfaulted without this.
i965 happened to work because it never ran _mesa_load_state_parameters()
on the new program before the test called glProgramLocalParameter(), which
was allocating a LocalParams array for the fallback path.

v2: Since v1 threw away old localparams data, leaked old LocalParams
    memory, only fixed fragment programs, and I was dubious of my previous
    invariants already (nothing but program_parse.y will generate
    LocalParams, and only that one path of program_parse.y will), just
    late-allocate localparams at the other point of dereferencing them.
    This adds overhead to _mesa_load_state_parameter, which is
    uncomfortable, but I'm pretty sure that giant switch statement is
    super slow already.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71734
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
mesa/swrast: fix inverted front buffer rendering with old-school swrast

I've no idea when this broke, but we have some people who wanted it fixed,
so here's my attempt.

reproducer, run readpix with swrast hit f, or run trival tri -sb things are
upside down, after this patch they aren't.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62142
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66213

Cc: <mesa-stable@lists.freedesktop.org>"
Signed-off-by: Dave Airlie <airlied@redhat.com>
glx: don't fail out when no configs if we have visuals

GLX 1.2 servers with no SGIX_fbconfigs exist (some citrix thing),
and we fail glxinfo completely in those cases.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
gallivm: Ignore unknown file type in non-debug builds.

Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
glsl: Use more portable bash invocation construct.

Fixes 'make check' on distros where bash is not at /bin/bash.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
i965: Add device info structs for Broadwell.

As always, the chipset limits here are placeholders, rather than the
actual values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Claim OpenGL 3.3 support on Broadwell.

Bugs aside, basically everything ought to work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Disable HiZ on Broadwell for now.

HiZ is difficult to implement, and while it's essential for performance,
we don't need it right away for purposes of hardware enabling.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>