glsl: Lower ir_binop_vector_extract to swizzle
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 15 Mar 2013 21:36:46 +0000 (14:36 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 13 May 2013 19:05:18 +0000 (12:05 -0700)
commit943de9cdeacb93d48ad5cb17666e7448990d3dbb
tree99a01c20a36089701f357c8a94b8706e511a30ee
parent63e1147ea12a393c0750698ea5909f41e1953e75
glsl: Lower ir_binop_vector_extract to swizzle

Lower ir_binop_vector_extract with a constant index to a swizzle.  This
is exactly like ir_dereference_array of a vector with a constant index.

v2: Convert tabs to spaces.  Suggested by Eric.

v3: Correctly call convert_vector_extract_to_swizzle in
ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir).  Suggested by
Ken.

v4: Use CLAMP instead of MIN2(MAX2()).  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/lower_vec_index_to_swizzle.cpp