[Mesa-dev] [PATCH v2 14/78] i965/vec4: Add auxiliary func to build a writemask from a component size

Eduardo Lima Mitev elima at igalia.com
Thu Jul 23 03:16:54 PDT 2015


New method brw_writemask_for_size() will return a writemask with the first 'size'
components activated.
---
 src/mesa/drivers/dri/i965/brw_reg.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index c8b1341..7355db6 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)
 {
-- 
2.1.4



More information about the mesa-dev mailing list