glsl, nir: Make ir_triop_bitfield_extract a vectorized operation.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 8 Jan 2016 00:01:51 +0000 (16:01 -0800)
committerMatt Turner <mattst88@gmail.com>
Wed, 13 Jan 2016 18:35:12 +0000 (10:35 -0800)
commit84d6130c21a8a570efefe54aa723f549b34c3256
treecdbcc4a92e22d368064449a48066d652c20c0270
parentb4e198f47f8423dfb101395cd6cb5a11fa12954e
glsl, nir: Make ir_triop_bitfield_extract a vectorized operation.

We would like to be able to combine

   result.x = bitfieldExtract(src0.x, src1.x, src2.x);
   result.y = bitfieldExtract(src0.y, src1.y, src2.y);
   result.z = bitfieldExtract(src0.z, src1.z, src2.z);
   result.w = bitfieldExtract(src0.w, src1.w, src2.w);

into a single ivec4 bitfieldInsert operation.  This should be possible
with most drivers.

This patch changes the offset and bits parameters from scalar ints
to ivecN or uvecN.  The type of all three operands will be the same,
for simplicity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/glsl/builtin_functions.cpp
src/glsl/ir.h
src/glsl/ir_constant_expression.cpp
src/glsl/ir_validate.cpp
src/glsl/lower_packing_builtins.cpp
src/glsl/nir/nir_opcodes.py