mesa: move unrefs of array objects earlier in _mesa_free_context_data()

If a non-default array object was bound at context destruction time
we'd try to unreference the array object after it was already deleted
in _mesa_free_varray_data().  Now do the unref first.

Fixes a regression from commit 86f53e6d6bd07e2bc3ffcadeb9a4418fbae06e0b.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
docs: freshen up the download/unpack instructions
docs: overhaul the Mesa build/install instructions

Rearrange thing in general.  Mark the legacy Makefile system as deprecated.
radeonsi: Fix sampler offsets for shader intrinsic.

The sampler number is in TGSI source register 1, and the S_LOAD_DWORD*
instructions take offsets in DWORDs, not bytes.
radeonsi: (User) SGPR related cleanups.

Use the same user SGPRs for the same purpose in vertex and pixel shaders.

Better calculation of the number of SGPRs to reserve.
radeonsi: Replace magic numbers for vertex buffer resource.
radeonsi: Fix VGPR_BIT() definition.

Fixes encoding of VOP3 shader instructions.

The shift was wrong for source registers 2 and 3, and the resulting value was
only 32 bits, so the shift in SICodeEmitter::VOPPostEncode() didn't work as
intended.
Revert "mesa: only update _MaxElement when we actually need it"

This reverts commit 0de5a21470b3bff9b7c8714e5d960d5ed9d01b9c.

I was wrong, we use it in the vbo module too.
This fixes a performance regression in Nexuiz.
glx: Use AM_CPPFLAGS to pass -I and -D to both C and C++ compiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
glsl: Use the column_types() helper method.

Ken noted this in a review of this patch that I pushed early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Fix up a comment explaining what a visitor class does.

Ken noted that some of the "actual work" was happening in the caller
of this class.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Rename the "whole_array_access" member in array splitting.

This was carried over from structure splitting, without thinking about
whether the name still made sense in this context.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Don't allow array splitting on function arguments.

This is the reason the declaration member existed in the reference
visitor, but I didn't copy the code from structure splitting that
avoided setting it.

This wasn't currently a problem, because we don't allow splitting of
in/out variables.  But that would be nice to change some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Fix up some comments in structure splitting, based on array-split work.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Convert the tests directory to automake.

This runs optimization-test and produces the usual automake test
output, which may be interesting to automated build systems.

This doesn't convert the tests to be individually exposed to the
automake runner, because automake doesn't like wildcards (due to being
nonportable in make, not that we care).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Track in each ir_variable whether it was ever assigned.

This will be used for some compile-and-link-time error checking, where
currently we've been doing error checking only at link time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Properly throw compile-time errors for conflicting FS output writes.

We were checking for these at link time previously, which is not as
early as mandated, and would actually fail to detect conflicting
writes if dead code removal removed some writes.

Fixes failures in piglit
glsl-*/compiler/fragment-outputs/write-gl_Frag*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Suppress printing the whole loop in BRW_OPCODE_DO annotation.
i965: Add basic block generator.

This takes the fs_inst list generated by the visitor, and generates a
list of basic blocks with edges between them.  This is a building
block for data-flow analysis.
i965: Add support for live variable analysis using dataflow analysis.