i965/vec4: Add auxiliary func to build a writemask from a component size
authorEduardo Lima Mitev <elima@igalia.com>
Tue, 16 Jun 2015 18:53:28 +0000 (20:53 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Aug 2015 16:40:47 +0000 (09:40 -0700)
New method brw_writemask_for_size() will return a writemask with the first
'size' components activated.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_reg.h

index 4867148c12fca39c86574136786c6b12db60bfbe..31806f769bd48da85c48092f93a916f220ed6879 100644 (file)
@@ -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)
 {