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>