i965/fs: Keep track of the register that hold delta_x/delta_y.
authorMatt Turner <mattst88@gmail.com>
Mon, 11 Aug 2014 02:03:34 +0000 (19:03 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 11 Aug 2014 17:40:01 +0000 (10:40 -0700)
They're needed in register allocation. Fixes a regression since
afe3d155.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78875
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp

index bf95b57f91aaf82c985576b3ede371cfeafb1237..3aee82226e07f36d93ab2ebd8731fe9733d1b462 100644 (file)
@@ -1749,6 +1749,20 @@ fs_visitor::compact_virtual_grfs()
             inst->src[i].reg = remap_table[inst->src[i].reg];
       }
    }
+
+   /* Patch all the references to delta_x/delta_y, since they're used in
+    * register allocation.
+    */
+   for (unsigned i = 0; i < ARRAY_SIZE(delta_x); i++) {
+      if (delta_x[i].file == GRF && remap_table[delta_x[i].reg] != -1) {
+         delta_x[i].reg = remap_table[delta_x[i].reg];
+      }
+   }
+   for (unsigned i = 0; i < ARRAY_SIZE(delta_y); i++) {
+      if (delta_y[i].file == GRF && remap_table[delta_y[i].reg] != -1) {
+         delta_y[i].reg = remap_table[delta_y[i].reg];
+      }
+   }
 }
 
 /*