glsl: Add lowering pass for ir_triop_vector_insert
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 18 Mar 2013 21:45:53 +0000 (14:45 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 13 May 2013 19:05:19 +0000 (12:05 -0700)
commitee7a6dad302ff5568566e325df56fd582be1afec
tree44d9126f87138c4083a118f63e556561ef7bcf04
parentb881ddba7d4a835f879ffe300661a72441448eee
glsl: Add lowering pass for ir_triop_vector_insert

This will eventually replace do_vec_index_to_cond_assign.  This lowering
pass is called in all the places where do_vec_index_to_cond_assign or
do_vec_index_to_swizzle is called.

v2: Use WRITEMASK_* instead of integer literals.  Use a more concise
method of generating broadcast_index.  Both suggested by Eric.

v3: Use a series of scalar compares instead of a single vector compare.
Suggested by Eric and Ken.  It still uses 'if (cond) v.x = y;' instead
of conditional assignments because ir_builder doesn't do conditional
assignments, and I'd rather keep the code simple.

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/Makefile.sources
src/glsl/glsl_parser_extras.cpp
src/glsl/ir_optimization.h
src/glsl/lower_vector_insert.cpp [new file with mode: 0644]
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp