i965: Align the start of attribute interp coefficients in FS to use PLN.
authorEric Anholt <eric@anholt.net>
Sat, 4 Sep 2010 00:21:49 +0000 (17:21 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 7 Sep 2010 17:34:09 +0000 (10:34 -0700)
src/mesa/drivers/dri/i965/brw_fs.cpp

index f0af8740d5f2b3c785c34342c2fafee43d04cdbb..b31d445afb1f70a46d3ef725aba5e2a91898cd79 100644 (file)
@@ -1514,6 +1514,14 @@ fs_visitor::assign_curb_setup()
    c->prog_data.first_curbe_grf = c->key.nr_payload_regs;
    c->prog_data.curb_read_length = ALIGN(c->prog_data.nr_params, 8) / 8;
 
+   if (intel->gen == 5 && (c->prog_data.first_curbe_grf +
+                          c->prog_data.curb_read_length) & 1) {
+      /* Align the start of the interpolation coefficients so that we can use
+       * the PLN instruction.
+       */
+      c->prog_data.first_curbe_grf++;
+   }
+
    /* Map the offsets in the UNIFORM file to fixed HW regs. */
    foreach_iter(exec_list_iterator, iter, this->instructions) {
       fs_inst *inst = (fs_inst *)iter.get();