pan/bi: Add bi_swz_16 helper

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>
This commit is contained in:
Alyssa Rosenzweig 2020-12-31 16:16:07 -05:00 committed by Marge Bot
parent 6bc7a0b366
commit f9bc168bd3

View file

@ -168,13 +168,19 @@ bi_word(bi_index idx, unsigned component)
/* Helps construct swizzles */
static inline bi_index
bi_half(bi_index idx, bool upper)
bi_swz_16(bi_index idx, bool x, bool y)
{
assert(idx.swizzle == BI_SWIZZLE_H01);
idx.swizzle = upper ? BI_SWIZZLE_H11 : BI_SWIZZLE_H00;
idx.swizzle = BI_SWIZZLE_H00 | (x << 1) | y;
return idx;
}
static inline bi_index
bi_half(bi_index idx, bool upper)
{
return bi_swz_16(idx, upper, upper);
}
static inline bi_index
bi_byte(bi_index idx, unsigned lane)
{