gallium: add vertex stream argument to EMIT/ENDPRIM

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
gallium: add support for stream in so info

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
gallium: add an index argument to create_query

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
gallium: add a cap for max vertex streams

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
mesa/st: add vertex stream support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
nvc0/ir: fix emitting vertex stream

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
nvc0/ir: avoid creating restarts with non-0 stream

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
nvc0/ir: only merge emit/restart for identical streams

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
nvc0: expose 4 vertex streams, use stream ids in xfb

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
st/mesa: don't ignore const buf index in src_register()

Otherwise, if we were creating a const buffer src register for a UBO
the index into the UBO was always zero.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
st/mesa: allow 2D indexing for all shader types in translate_src()

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
st/mesa: don't use address register for constant-indexed ir_binop_ubo_load

Before, we were always using the address register and indirect addressing
to index into a UBO constant buffer.  With this change we only do that
when necessary.

Using the piglit bin/arb_uniform_buffer_object-rendering test as an
example:

Shader code:
  uniform ub_rot {float rotation; };
  ...
  m[1][1] = cos(rotation);

Before:
  IMM[1] INT32 {0, 1, 0, 0}
  1: UARL ADDR[0].x, IMM[1].xxxx
  2: MOV TEMP[0].x, CONST[3][ADDR[0].x].xxxx
  3: COS TEMP[1].x, TEMP[0].xxxx

After:
  0: COS TEMP[0].x, CONST[3][0].xxxx

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
st/mesa: fix incorrect size of UBO declarations

UniformBufferSize is in bytes so we need to divide by 16 to get the
number of constant buffer slots.  Also, the ureg_DECL_constant2D()
function takes first..last parameters so we need to subtract one
for the last value.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
mesa: update comment for UniformBufferSize to indicate size is in bytes

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
mesa: fix the condition in src/loader/Makefile.am

We want to have the dri common files compiled to define USE_DRICONF.
We need to check both NEED_OPENGL_COMMON and HAVE_DRICOMMON

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: Brian Paul <brianp@vmware.com>
glsl: Add typed foreach_in_list/_reverse macros.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glsl: Add typed foreach_in_list_safe macro.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glsl: Use typed foreach_in_list instead of foreach_list.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mesa: Use typed foreach_in_list instead of foreach_list.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glsl: Use typed foreach_in_list_safe instead of foreach_list_safe.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>