[Mesa-dev] [PATCH] i965/fs: Keep track of the register that hold delta_x/delta_y.

Matt Turner mattst88 at gmail.com
Sun Aug 10 19:06:01 PDT 2014


They're needed in register allocation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78875
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index cfe2073..5b7ad67 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1769,6 +1769,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->file == GRF && remap_table[delta_x->reg] != -1) {
+         delta_x->reg = remap_table[delta_x->reg];
+      }
+   }
+   for (unsigned i = 0; i < ARRAY_SIZE(delta_y); i++) {
+      if (delta_y->file == GRF && remap_table[delta_y->reg] != -1) {
+         delta_y->reg = remap_table[delta_y->reg];
+      }
+   }
 }
 
 /*
-- 
1.8.5.5



More information about the mesa-dev mailing list