glsl: Convert lower_vec_index_to_swizzle to a rvalue visitor.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 28 Apr 2016 03:51:36 +0000 (20:51 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 29 Apr 2016 23:03:29 +0000 (16:03 -0700)
commit1cd600dbb975cce616da376a680692afb2da47f9
treeabaafda8dd3bb7f9633847eb8834ce708232e676
parentd53cf1ea4cfed9c24a2ff9097c77086f8105ce13
glsl: Convert lower_vec_index_to_swizzle to a rvalue visitor.

The old visitor missed some cases.  For example, it wouldn't handle
an ir_dereference_array with a vector_extract as the index.

Rather than trying to add the missing cases, just rewrite it as an
ir_rvalue_visitor.  This makes it easy to replace any expression,
and is much less code.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/lower_vec_index_to_swizzle.cpp