glsl: Generated masked write instead of vector array index for UBO lowering
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 23 Mar 2013 01:55:49 +0000 (18:55 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 29 Mar 2013 19:01:14 +0000 (12:01 -0700)
commite0131196caad52a33e460775fa537fd57a8b29e5
tree942a197136491badb2902113a912eebe473bee20
parent65cc68f4305a675e27feb7aae0d8a66b2710f3e4
glsl: Generated masked write instead of vector array index for UBO lowering

When reading a column from a row-major matrix, we would slot the single
value read into the vector using an ir_dereference_array of the vector
with a constant index.  This will (eventually) get optimized to a
masked-write, so just generate the masked write in the first place.

v2: Remove unused variable 'chan'.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Eric Anholt <eric@anholt.net>
src/glsl/lower_ubo_reference.cpp