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 <jason.ekstrand@intel.com>
This commit is contained in:
Eduardo Lima Mitev 2015-06-16 20:53:28 +02:00 committed by Jason Ekstrand
parent 6e58fc56a5
commit a5a3287f73
1 changed files with 6 additions and 0 deletions

View 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)
{