[Mesa-dev] [PATCH 14/17] i965/fs_builder: Use dispatch_width instead of reg.width for offset and half

Jason Ekstrand jason at jlekstrand.net
Thu Jun 18 17:51:43 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_fs_builder.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_builder.h b/src/mesa/drivers/dri/i965/brw_fs_builder.h
index 7d3c8ab..58519d7 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_builder.h
+++ b/src/mesa/drivers/dri/i965/brw_fs_builder.h
@@ -161,7 +161,7 @@ namespace brw {
          case MRF:
          case ATTR:
             return byte_offset(reg,
-                               delta * MAX2(reg.width * reg.stride, 1) *
+                               delta * dispatch_width() * reg.stride *
                                type_sz(reg.type));
          case UNIFORM:
             reg.reg_offset += delta;
@@ -185,9 +185,9 @@ namespace brw {
 
          case GRF:
          case MRF:
-            assert(reg.width == 16);
-            reg.width = 8;
-            return horiz_offset(reg, 8 * idx);
+            assert(dispatch_width() == 16);
+            reg.width = dispatch_width() / 2;
+            return horiz_offset(reg, (dispatch_width() / 2) * idx);
 
          case ATTR:
          case HW_REG:
-- 
2.4.3



More information about the mesa-dev mailing list