r600g: Drop references to destroyed blend state

Fixes use-after-free when the currently bound blend state is destroyed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85267
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84140

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>

Cc: mesa-stable@lists.freedesktop.org
r300g: implement pipe_rasterizer_state::clip_halfz

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
r600g: implement pipe_rasterizer_state::clip_halfz

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
radeonsi: implement pipe_rasterizer_state::clip_halfz

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
glsl: Fix crash due to negative array index

Currently Mesa crashes with a shader like this:

[fragmnet shader]
float[5] array;
int idx = -2;
void main()
{
   gl_FragColor = vec4(0.0, 1.0, 0.0, array[idx]);
}

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
glsl: Use signed array index in update_max_array_access()

Avoids a crash in case of negative array index is used in a
shader program.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
u_blitter: do error checking assertions for shader caching

If the user calls util_blitter_cache_all_shaders() set a flag and assert
that we never try to create any new fragment shaders after that point.
If the assertions fails, it means we missed generating some shader in
util_blitter_cache_all_shaders().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
u_blitter: create basic fs shaders in util_blitter_cache_all_shaders()

We need to create all fs shaders in this function.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
u_blitter: use ctx->bind_fs_state(), not pipe->bind_fs_state()

Consistently use the function pointer we saved earlier.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
u_blitter: put a comment on util_blitter_cache_all_shaders()

Trivial.
mesa: remove conditional render and rgtc from ES3 requirements

The functionality exposed by those extensions does not appear in ES3

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
gallivm,llvmpipe,clover: Bump required LLVM version to 3.3.

We'll need to update gallivm for the interface changes in LLVM 3.6, and
the fewer the number of older LLVM versions we support the less hairy that
will be.

As consequence HAVE_AVX define can disappear.  (Note HAVE_AVX meant
whether LLVM version supports AVX or not.  Runtime support for AVX is
always checked and enforced independently.)

Verified llvmpipe builds and runs with with LLVM 3.3, 3.4, and 3.5.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
gallivm: Fix white-space.

Replace tabs with spaces.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
gallivm: Properly update for removal of JITMemoryManager in LLVM 3.6.

JITMemoryManager was removed in LLVM 3.6, and replaced by its base class
RTDyldMemoryManager.

This change fixes our JIT memory managers specializations to derive from
RTDyldMemoryManager in LLVM 3.6 instead of JITMemoryManager.

This enables llvmpipe to run with LLVM 3.6.

However, lp_free_generated_code is basically a no-op because there are
not enough hook points in RTDyldMemoryManager to track and free the code
of a module.  In other words, with MCJIT, code once created, stays
forever allocated until process destruction.  This is not speicfic to
LLVM 3.6 -- it will happen whenever MCJIT is used regardless of version.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
gallivm: Fix build with LLVM 3.3.

The setMCJITMemoryManager method doesn't exist in LLVM 3.3.

I thought I had tested the latest version of my earlier change with LLVM
3.3, but it looks I missed it.

Trivial.
u_math.h: fix 64 to 32 bit truncation warning

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
wgl: stw_pixelformat_get_info: correct type for index variable

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa/shaderimage.c: fix inconsistent sign warning

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
gallium/nouveau: fully build the driver under android

Fix the trivial typo in the variable name.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
auxiliary/os: get the mmap/munmap wrappers working with android

 - Use macro for munmap under Android - the STATIC_ASSERT uses
a off_t which is not used under Android for mmap. As loff_t size
does not vary as does off_t just ignore the assert.

 - Wrap the long lines to improve readability.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>