clover: Fix build with LLVM 3.4

Reported on IRC by lordheavy
radeonsi/compute: Fix memory leak in radeonsi_launch_grid.

Fixes "Resource leak" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
llvmpipe: fix a bug in opaque optimization

If there are queries active the opaque optimization reseting the bin needs to
be disabled.
(Not really tested since the bug was discovered by code inspection not
an actual test failure.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
llvmpipe: remove never reached code for timestamp queries.

timestamp queries are always binned in an active scene, therefore
always have a result.
llvmpipe: handle offset_clamp

This was just ignored (unless for some reason like unfilled polys draw was
handling this).
I'm not convinced of that code, putting the float for the clamp in the key
isn't really a good idea. Then again the other floats for depth bias are
already in there too anyway (should probably have a jit_context for the
setup function), so this is just a quick fix.
Also, the "minimum resolvable depth difference" used isn't really right as it
should be calculated according to the z values of the current primitive
and not be a constant (of course, this only makes a difference for float
depth buffers), at least for d3d10, so depth biasing is still not quite right.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
i965,i915: Return early if miptree allocation fails

If allocation fails in intel_miptree_create_layout(), don't proceed to
dereference the miptree. Return an early NULL.

Fixes static analysis error reported by Klocwork.

Note: This is a candidate for the 9.1 branch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
mesa: Remove GL_EXT_clip_volume_hint

As far as I can tell, no driver has enabled this extension since c6499a7
back in 2007.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
ilo: avoid potential dangling pointer dereference

Set pipe_draw_info to NULL after draw_vbo().
ilo: track if primitive restart has changed

Re-emit 3DSTATE_INDEX_BUFFER to enable/disable primitive restart.
ilo: use shorter names for dirty flags

The new names match those of ilo_context's members respectively, and are
shorter.
glsl: Initialize member variable is_ubo_var in constructor.

Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
ilo: clean up states that take a start_slot

They are similar, so clean them up to make them look similar.
ilo: clean up ilo_set_constant_buffer()

Add loops that will be optimized away.
ilo: remove ilo_cbuf_state::count

We can derive it from enabled_mask.
ilo: clean up states that use ilo_view_surface

Use variables that are easier to remember what they are.
svga: use switch statement in svga_shader_type()

Safer in case the PIPE_SHADER_x tokens get renumbered (as Marek
wanted to do).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
svga: pass svga_compile_key by reference instead of value

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
r600g/compute: Move compute_shader_create() function into evergreen_compute.c

Tested-by: Aaron Watry <awatry@gmail.com>
r600g/compute: Accept LDS size from the LLVM backend

And allocate the correct amount before dispatching the kernel.

Tested-by: Aaron Watry <awatry@gmail.com>
mesa: Fix build with older gcc since update of glext.h

Reviewed-by: Brian Paul <brianp@vmware.com>