nir/opt_vectorize: fix typo in instr_can_rewrite()
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 8 Jan 2021 15:13:44 +0000 (15:13 +0000)
committerMarge Bot <eric+marge@anholt.net>
Sat, 9 Jan 2021 11:14:05 +0000 (11:14 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8391>

src/compiler/nir/nir_opt_vectorize.c

index 5c2873b..80cfdbb 100644 (file)
@@ -158,7 +158,7 @@ instr_can_rewrite(nir_instr *instr, bool vectorize_16bit)
           * outside of max_components: these should better be scalarized */
          uint32_t mask = vectorize_16bit ? ~1 : ~3;
          for (unsigned j = 0; j < alu->dest.dest.ssa.num_components; j++) {
-            if ((alu->src[i].swizzle[0] & mask) != (alu->src[i].swizzle[i] & mask))
+            if ((alu->src[i].swizzle[0] & mask) != (alu->src[i].swizzle[j] & mask))
                return false;
          }
       }