draw: account for separate shader objects in geometry shader code

The geometry shader code seems to have been originally written with the
assumptions that there are the same number of VS outputs as GS outputs and
that VS outputs are in the same order as their corresponding GS inputs. Since
TGSI uses separate shader objects, these are both wrong assumptions. This
was causing several valid vertex/geometry shader combinations to either render
incorrectly or trigger an assertion.

Conflicts:
	src/gallium/auxiliary/draw/draw_gs.c

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
draw: use geometry shader info in clip_init_state if appropriate

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
draw/llvm: fix inputs to the geometry shader

We can't clip and viewport transform the vertices before we let
the geometry shader process them. Lets make sure the generated
vertex shader has both disabled if geometry shader is present.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
r600g/llvm: Update CONSTANT_BUFFER address space definition

To match recent LLVM changes.

Signed-off-by: Christian König <christian.koenig@amd.com>
radeonsi: switch to v*i8 for resources and samplers v2

v2: remove unrelated changes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeon/llvm: replace shader type intrinsic with function attribute

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeon/llvm: make SGPRs proper function arguments v2

v2: remove unrelated changes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeonsi: remove SI.vs.load.buffer.index

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeonsi: rework input interpolation

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeonsi: add LLVMNoUnwindAttribute to intrinsic

So LLVM can better eliminate dead code.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeon/llvm: enable LICM and DCE pass v2

LICM stands for Loop Invariant Code Motion. Instructions that
does not depend of loop index are moved outside of loop body.

DCE is DeadCodeElimination.

v2: updated commit msg, thx to Vincent.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
radeon/llvm: document LLVM commit

We need at least that revision to work correctly now.

Signed-off-by: Christian König <christian.koenig@amd.com>
mesa: fix glGetInteger*(GL_SAMPLER_BINDING).

If the sampler object has been deleted on another context, an
alternative context may reference the old sampler. So ensure the sampler
object still exists.

Note: this is a candidate for the stable branch.

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
vbo: fix crash found with shared display lists

This fixes a crash when a display list is created in one context
but executed from a second one.  The vbo_save_context::vertex_store
memeber will be NULL if we never created a display list with the
context.  Just check for that before dereferencing the pointer.

Fixes http://bugzilla.redhat.com/show_bug.cgi?id=918661

Note: This is a candidate for the stable branches.
llvmpipe: remove the power of two sizeof(struct cmd_block) assertion

It fails on 32-bit systems (I only tested on 64-bit).  Power of two
size isn't required, so just remove the assertion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
draw: add const qualifier to silence compiler warning
dri/nouveau: fix crash in nouveau_flush

https://bugs.freedesktop.org/show_bug.cgi?id=61947

Note: this is a candidate for the stable branches
docs: document another Viewperf bug
i915g: Update TODO
i915g: Use PIPE_FLUSH_END_OF_FRAME to trigger throttling

This helps with jittering, instead of throttling at every command
buffer we only throttle once a frame.