summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-09-11 16:15:10 -0700
committerJason Ekstrand <[email protected]>2014-09-30 10:29:15 -0700
commit65ddf6f40469c5da1e5daf4270ca698a03860472 (patch)
tree18f812ec0e351a019c6adbac8bfe1d2dc4138588
parent30d718c2fbaeeffb24468ce773e44a6bf6f6aa2a (diff)
i965/fs: Add a function for getting a component of a 8 or 16-wide register
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index e5202f0850b..57c5dc3fe47 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -162,6 +162,16 @@ offset(fs_reg reg, unsigned delta)
return reg;
}
+static inline fs_reg
+component(fs_reg reg, unsigned idx)
+{
+ assert(reg.subreg_offset == 0);
+ assert(idx < reg.width);
+ reg.subreg_offset = idx * type_sz(reg.type);
+ reg.width = 1;
+ return reg;
+}
+
/**
* Get either of the 8-component halves of a 16-component register.
*