From: Francisco Jerez <[email protected]>

Change-Id: I3b9bda911b04eb3046f359b5aea688a8f8e974ec
---
 src/intel/compiler/brw_fs_visitor.cpp | 24 ++++++++++++------------
 src/intel/compiler/brw_ir_fs.h        |  1 -
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/intel/compiler/brw_fs_visitor.cpp 
b/src/intel/compiler/brw_fs_visitor.cpp
index bce40f4..ba3cea1 100644
--- a/src/intel/compiler/brw_fs_visitor.cpp
+++ b/src/intel/compiler/brw_fs_visitor.cpp
@@ -268,32 +268,32 @@ fs_visitor::emit_interpolation_setup_gen6()
        1 << BRW_BARYCENTRIC_NONPERSPECTIVE_CENTROID);
 
    for (int i = 0; i < BRW_BARYCENTRIC_MODE_COUNT; ++i) {
-      uint8_t reg = payload.barycentric_coord_reg[i];
-      this->delta_xy[i] = fs_reg(brw_vec16_grf(reg, 0));
+      this->delta_xy[i] =
+         fs_reg(brw_vec8_grf(payload.barycentric_coord_reg[i], 0));
 
       if (devinfo->needs_unlit_centroid_workaround &&
           (centroid_modes & (1 << i))) {
+         const fs_reg &pixel_delta_xy = delta_xy[i - 1];
+
          /* Get the pixel/sample mask into f0 so that we know which
           * pixels are lit.  Then, for each channel that is unlit,
           * replace the centroid data with non-centroid data.
           */
          bld.emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS);
 
-         uint8_t pixel_reg = payload.barycentric_coord_reg[i - 1];
-
          set_predicate_inv(BRW_PREDICATE_NORMAL, true,
-                           bld.half(0).MOV(brw_vec8_grf(reg, 0),
-                                           brw_vec8_grf(pixel_reg, 0)));
+                           bld.half(0).MOV(half(delta_xy[i], 0),
+                                           half(pixel_delta_xy, 0)));
          set_predicate_inv(BRW_PREDICATE_NORMAL, true,
-                           bld.half(0).MOV(brw_vec8_grf(reg + 1, 0),
-                                           brw_vec8_grf(pixel_reg + 1, 0)));
+                           bld.half(0).MOV(half(delta_xy[i], 1),
+                                           half(pixel_delta_xy, 1)));
          if (dispatch_width == 16) {
             set_predicate_inv(BRW_PREDICATE_NORMAL, true,
-                              bld.half(1).MOV(brw_vec8_grf(reg + 2, 0),
-                                              brw_vec8_grf(pixel_reg + 2, 0)));
+                              bld.half(1).MOV(half(delta_xy[i], 2),
+                                              half(pixel_delta_xy, 2)));
             set_predicate_inv(BRW_PREDICATE_NORMAL, true,
-                              bld.half(1).MOV(brw_vec8_grf(reg + 3, 0),
-                                              brw_vec8_grf(pixel_reg + 3, 0)));
+                              bld.half(1).MOV(half(delta_xy[i], 3),
+                                              half(pixel_delta_xy, 3)));
          }
          assert(dispatch_width != 32); /* not implemented yet */
       }
diff --git a/src/intel/compiler/brw_ir_fs.h b/src/intel/compiler/brw_ir_fs.h
index 6595735..fcc4be7 100644
--- a/src/intel/compiler/brw_ir_fs.h
+++ b/src/intel/compiler/brw_ir_fs.h
@@ -281,7 +281,6 @@ is_uniform(const fs_reg &reg)
 static inline fs_reg
 half(const fs_reg &reg, unsigned idx)
 {
-   assert(idx < 2);
    return horiz_offset(reg, 8 * idx);
 }
 
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to