mesa: add texture gather changes

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: add texture gather changes

V2 [Chris Forbes]:
   - Add new pattern, fixup parameter reading.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: add SHADER_OPCODE_TG4

Adds the Gen7 message IDs, a new SHADER_OPCODE_TG4 pseudo-op, and
low-level support for emitting it via generate_tex().

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Add support for ir_tg4

Lowers ir_tg4 (from textureGather and textureGatherOffset builtins) to
SHADER_OPCODE_TG4.

The usual post-sampling swizzle workaround can't work for ir_tg4,
so avoid doing that:

* For R/G/B/A swizzles use the hardware channel select (lives in the
   same dword in the header as the texel offset), and then don't do
   anything afterward in the shader.
* For 0/1 swizzles blast the appropriate constant over all the output
   channels in swizzle_result().

V2: Avoid duplicating header enabling block

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965/vs: Add support for ir_tg4

Pretty much the same as the FS case. Channel select goes in the header,
post-sampling swizzle only does the 0/1 cases.

V2: Less mangling.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: Enable ARB_texture_gather on Gen7

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>