summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2015-06-16 20:53:28 +0200
committerJason Ekstrand <[email protected]>2015-08-03 09:40:47 -0700
commita5a3287f7392356386aa305c791d94b6d5dde6cc (patch)
treef75a4950d0be256c7ba8409f5579681ebd4c5d17 /src
parent6e58fc56a5a396020cd299db11895120ec3da520 (diff)
i965/vec4: Add auxiliary func to build a writemask from a component size
New method brw_writemask_for_size() will return a writemask with the first 'size' components activated. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_reg.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index 4867148c12f..31806f769bd 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -950,6 +950,12 @@ brw_set_writemask(struct brw_reg reg, unsigned mask)
return reg;
}
+static inline unsigned
+brw_writemask_for_size(unsigned n)
+{
+ return (1 << n) - 1;
+}
+
static inline struct brw_reg
negate(struct brw_reg reg)
{