pan/bi: Add helper to extract a word from an index
This pattern comes up surprisingly often due to the prevalance of vectors. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
This commit is contained in:
@@ -471,6 +471,14 @@ bi_passthrough(enum bifrost_packed_src value)
|
||||
};
|
||||
}
|
||||
|
||||
/* Extracts a word from a vectored index */
|
||||
static inline bi_index
|
||||
bi_word(bi_index idx, unsigned component)
|
||||
{
|
||||
idx.offset += component;
|
||||
return idx;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
bi_is_null(bi_index idx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user