From: Eduardo Lima Mitev Date: Tue, 16 Jun 2015 18:53:28 +0000 (+0200) Subject: i965/vec4: Add auxiliary func to build a writemask from a component size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5a3287f7392356386aa305c791d94b6d5dde6cc;p=mesa.git 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 --- 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) {