glsl: Ignore redundant prototypes after a function's been defined.

Consider the following shader:

    vec4 f(vec4 v) { return v; }
    vec4 f(vec4 v);

The prototype exactly matches the signature of the earlier definition,
so there's absolutely no point in it.  However, it doesn't appear to
be illegal.  The GLSL 4.30 specification offers two relevant quotes:

"If a function name is declared twice with the same parameter types,
 then the return types and all qualifiers must also match, and it is the
 same function being declared."

"User-defined functions can have multiple declarations, but only one
 definition."

In this case the same function was declared twice, and there's only one
definition, which fits both pieces of text.  There doesn't appear to be
any text saying late prototypes are illegal, so presumably it's valid.

Unfortunately, it currently triggers an assertion failure:
ir_dereference_variable @ <p1> specifies undeclared variable `v' @ <p2>

When we process the second line, we look for an existing exact match so
we can enforce the one-definition rule.  We then leave sig set to that
existing function, and hit sig->replace_parameters(&hir_parameters),
unfortunately nuking our existing definition's parameters (which have
actual dereferences) with the prototype's bogus unused parameters.

Simply bailing out and ignoring such late prototypes is the safest
thing to do.

Fixes Piglit's late-proto.vert as well as 3DMark/Ice Storm for Android.

NOTE: This is a candidate for stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
ilo: fix indentation of ilo_gpe_gen*.h
ilo: add ilo_dev_info shared by the screen and contexts

The struct is used to describe the device information, such as PCI ID, GEN,
GT, and etc.
ilo: use ilo_dev_info in GPE and 3D pipeline

We need only dev->gen and dev->gt, but it makes sense to expose other
information to the pipeline.
ilo: use ilo_dev_info in toy compiler

We need only dev->gen, but it makes sense to expose other information to the
compiler.
ilo: move device limits to ilo_dev_info or to GPEs

It seems a bit weird to have device limits in a context.
ilo: support and prefer compact array spacing

There is no reason to waste the memory when the HW can support compact array
spacing (ARYSPC_LOD0).
ilo: use UMS layout for render targets

As we do not advertise MSAA support, this change should not make any
difference yet.
ilo: fix tiling/size for special-purpose resources

We do not allocate such resources yet though.
ilo: allow one-off flags to be specified for CP

It will be used for SOL_RESET on GEN7.
ilo: expose register indices of OUTs in ilo_shader

pipe_stream_output_info tells us which of OUT[i] needs to be written out.
We need the info to map OUT[i] to VUE offset.
ilo: add gen6_pipeline_update_max_svbi()

Move max_svbi calculation to a helper function and make it available for other
GENs.
ilo: implement GEN7 SO GPE functions

They were just stubs before.
ilo: correctly program SO states for GEN7

With the commands supported by GPE, we can finally program the states.
ilo: reset SO write offsets for new SO targets

When the SO targets are changed and no appending is requested, we need to send
SOL_RESET on GEN7+.
ilo: enable SO support on GEN7
ilo: fix PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS

On GEN7+, is->dev.has_gen7_sol_reset is required.
swrast: add casts for ImageSlices pointer arithmetic

MSVC doesn't like pointer arithmetic with void * so use GLubyte *.

Reviewed-by: Jose Fonseca<jfonseca@vmware.com>
vl/compositor: cleanup background clearing

Add an extra parameter to specify if we should clear the render target.

Signed-off-by: Christian König <christian.koenig@amd.com>
vl/buffer: use 2D_ARRAY instead of 3D textures

Signed-off-by: Christian König <christian.koenig@amd.com>