i965/fs: Move offset(fs_reg, unsigned) to brw_fs.h
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 25 Jun 2015 17:55:51 +0000 (10:55 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Jun 2015 23:11:19 +0000 (16:11 -0700)
Shortly, offset() will depend on the builder so we need it moved to some
place where it has access to that.

Reviewed-by: Iago Toral Quiroga <itoral@igali.com>
Acked-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_ir_fs.h

index f20b540020f54c16a7fad847b14917cb89784712..06f46765dd10c184e6899cd17b51df0f94832c6a 100644 (file)
@@ -62,6 +62,27 @@ namespace brw {
    class fs_live_variables;
 }
 
+static inline fs_reg
+offset(fs_reg reg, unsigned delta)
+{
+   switch (reg.file) {
+   case BAD_FILE:
+      break;
+   case GRF:
+   case MRF:
+   case ATTR:
+      return byte_offset(reg,
+                         delta * MAX2(reg.width * reg.stride, 1) *
+                         type_sz(reg.type));
+   case UNIFORM:
+      reg.reg_offset += delta;
+      break;
+   default:
+      assert(delta == 0);
+   }
+   return reg;
+}
+
 /**
  * The fragment shader front-end.
  *
index 96dc20da3cf13a94442a3b7fea0ee083484ef171..16b20beb7882dc8ba609159a9dee12f38dbaa2a7 100644 (file)
@@ -128,27 +128,6 @@ horiz_offset(fs_reg reg, unsigned delta)
    return reg;
 }
 
-static inline fs_reg
-offset(fs_reg reg, unsigned delta)
-{
-   switch (reg.file) {
-   case BAD_FILE:
-      break;
-   case GRF:
-   case MRF:
-   case ATTR:
-      return byte_offset(reg,
-                         delta * MAX2(reg.width * reg.stride, 1) *
-                         type_sz(reg.type));
-   case UNIFORM:
-      reg.reg_offset += delta;
-      break;
-   default:
-      assert(delta == 0);
-   }
-   return reg;
-}
-
 static inline fs_reg
 component(fs_reg reg, unsigned idx)
 {