nir: Fix output swizzle in get_mul_for_src
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Thu, 11 Jun 2015 10:32:26 +0000 (12:32 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Aug 2015 16:40:50 +0000 (09:40 -0700)
commit418c004f802e63ca4e9f3456a46498d2fc543854
tree45904a9d62c917c03b186fd8d08eb8e6021b54d0
parent19cf934f7f18237e1a212b0a019026d5d36c6fac
nir: Fix output swizzle in get_mul_for_src

Avoid copying an overwritten swizzle, use the original values.

Example:

   Former swizzle[] = xyzw
   src->swizzle[] = zyxx

The expected output swizzle = zyxx but if we reuse swizzle in the loop,
then output swizzle would be zyzz.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir_opt_peephole_ffma.c