i965/vec4: Don't reswizzle hardware registers
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 10 Sep 2015 23:19:42 +0000 (16:19 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 12 Sep 2015 17:46:26 +0000 (10:46 -0700)
Cc: "11.0 10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91719
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.cpp

index c4da1a11be8e8f98105c29bf15a37b64a3217172..9d863c273e94b318d6a4fc7f4caa162e8afd50ff 100644 (file)
@@ -954,6 +954,14 @@ vec4_instruction::can_reswizzle(int dst_writemask,
    if (mlen > 0)
       return false;
 
+   /* We can't use swizzles on the accumulator and that's really the only
+    * HW_REG we would care to reswizzle so just disallow them all.
+    */
+   for (int i = 0; i < 3; i++) {
+      if (src[i].file == HW_REG)
+         return false;
+   }
+
    return true;
 }