mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
pan/bi: Add bi_replace_index helper
I keep open-coding this, incorrectly... Since bi_index contains both "position" and "modifier" data, it's common to want to swap the position while preserving modifiers. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8973>
This commit is contained in:
parent
54beea9799
commit
be02c0868c
1 changed files with 11 additions and 0 deletions
|
|
@ -199,6 +199,17 @@ bi_neg(bi_index idx)
|
|||
return idx;
|
||||
}
|
||||
|
||||
/* Replaces an index, preserving any modifiers */
|
||||
|
||||
static inline bi_index
|
||||
bi_replace_index(bi_index old, bi_index replacement)
|
||||
{
|
||||
replacement.abs = old.abs;
|
||||
replacement.neg = old.neg;
|
||||
replacement.swizzle = old.swizzle;
|
||||
return replacement;
|
||||
}
|
||||
|
||||
/* For bitwise instructions */
|
||||
#define bi_not(x) bi_neg(x)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue