ilo: clean up 3D/media functions

Mostly style changes to set dw[0] directly.
mesa: check that uniform exists in glUniform* functions

Remap table for uniforms may contain empty entries when using explicit
uniform locations. If no active/inactive variable exists with given
location, remap table contains NULL.

v2: move remap table bounds check before existence check (Ian Romanick)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Erik Faye-Lund <kusmabite@gmail.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83574
Generate a warning when not writing gl_Position with GLES.

With GLES we don't give any kind of warning in case we don't
write to gl_position. This patch makes changes so that we
generate a warning in case of GLES (VER < 300) and an error
in case of GL.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
mesa: break up _mesa_swizzle_and_convert() to reduce compile time

This reduces gcc -O3 compile time to 1/4 of what it was on my system.
Reduces MSVC release build time too.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
mesa: move i, j var decls into SWIZZLE_CONVERT_LOOP() macro

Put macro code in do {} while loop and put semicolons on macro calls
so auto indentation works properly.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
vc4: Reuse the util header instead of defining our own ARRAY_SIZE.

Fixes redefinition warnings if you end up including this header before
util stuff.
vc4: Fix memory leaks of some vc4_compile contents.
vc4: Fix memory leaks of struct qinst.
vc4: Dynamically allocate the TGSI-to-qreg arrays.

Fixes buffer overflows in some piglit tests (which are still failing to
register allocate anyway).
vc4: Bump maximum uniforms count to match other drivers.

We don't have any specific limits in the hardware, just like the other
GPUs, so match their behavior.  Fixes minmax_gles2 and several other
piglit tests relying on the specced uniform minmax values.
vc4: Bump maximum ARB program temporaries to match Intel/AMD.

This query has always been useless, but we could potentially reject
well-formed, runnable programs if we expose a value that's too low.