diff options
author | Timothy Arceri <[email protected]> | 2016-06-23 12:52:05 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-07-21 12:06:11 +1000 |
commit | 138aad06b3bc577f7ee2970ad02f3381da451896 (patch) | |
tree | 0c54f66957e1f95a3e0c8b9c5055bb9357570222 /src/mesa/drivers | |
parent | 4b57b53f85a7b125fa19508b5dcdd92b9e00c25f (diff) |
i965: add helper for creating packing writemask
For example where n=3 first_component=1 this will give us
0xE (WRITEMASK_YZW).
V2:
Add assert to check first component is <= 4 (Suggested by Ken)
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_reg.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h index 7eab7b51e38..5b427b22230 100644 --- a/src/mesa/drivers/dri/i965/brw_reg.h +++ b/src/mesa/drivers/dri/i965/brw_reg.h @@ -972,6 +972,13 @@ brw_writemask_for_size(unsigned n) return (1 << n) - 1; } +static inline unsigned +brw_writemask_for_component_packing(unsigned n, unsigned first_component) +{ + assert(first_component + n <= 4); + return (((1 << n) - 1) << first_component); +} + static inline struct brw_reg negate(struct brw_reg reg) { |