summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h18
-rw-r--r--src/mesa/drivers/dri/i965/brw_ir_fs.h19
2 files changed, 21 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index d28384d8216..4c1ac9cedd2 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -44,23 +44,9 @@ namespace brw {
struct brw_gs_compile;
static inline fs_reg
-offset(fs_reg reg, const brw::fs_builder& bld, unsigned delta)
+offset(const fs_reg &reg, const brw::fs_builder &bld, unsigned delta)
{
- switch (reg.file) {
- case BAD_FILE:
- break;
- case ARF:
- case FIXED_GRF:
- case MRF:
- case VGRF:
- case ATTR:
- case UNIFORM:
- return byte_offset(reg,
- delta * reg.component_size(bld.dispatch_width()));
- case IMM:
- assert(delta == 0);
- }
- return reg;
+ return offset(reg, bld.dispatch_width(), delta);
}
/**
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index 06a74fab94d..35169f8464f 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -140,6 +140,25 @@ horiz_offset(const fs_reg &reg, unsigned delta)
unreachable("Invalid register file");
}
+static inline fs_reg
+offset(fs_reg reg, unsigned width, unsigned delta)
+{
+ switch (reg.file) {
+ case BAD_FILE:
+ break;
+ case ARF:
+ case FIXED_GRF:
+ case MRF:
+ case VGRF:
+ case ATTR:
+ case UNIFORM:
+ return byte_offset(reg, delta * reg.component_size(width));
+ case IMM:
+ assert(delta == 0);
+ }
+ return reg;
+}
+
/**
* Get the scalar channel of \p reg given by \p idx and replicate it to all
* channels of the result.