nir/lower_vec_to_movs: Get rid of start_idx and swizzle compacting
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 Sep 2015 21:47:28 +0000 (14:47 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Sep 2015 18:13:48 +0000 (11:13 -0700)
commit2b2f1f16a04dfba4e02a7f331befb5bd94d4a1be
tree0a88f0f484913cc2d84c40b954c374b56e761976
parentc951bb83056724df02ba7e6fe2dfa720c0f45c1f
nir/lower_vec_to_movs: Get rid of start_idx and swizzle compacting

Previously, we did this thing with keeping track of a separate start_idx
which was different from the iteration variable.  I think this was a relic
of the way that GLSL IR implements writemasks.  In NIR, if a given bit in
the writemask is unset then that channel is just "unused", not missing.  In
particular, a vec4 operation with a writemask of 0xd will use sources 0, 2,
and 3 and leave source 1 alone.  We can simplify things a good deal (and
make them correct) by removing this "compacting" step.

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/nir/nir_lower_vec_to_movs.c