mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
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 <kenneth@whitecape.org> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
parent
4b57b53f85
commit
138aad06b3
1 changed files with 7 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue