mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 00:20:11 +01:00
pan/bi: Add helpers to get vertex/instance ID
These are preloaded in different places across Bifrost and Valhall. Abstract that away so code using the builder isn't littered with "is Valhall?" checks. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
This commit is contained in:
parent
76a09b8cd3
commit
1e37113ede
1 changed files with 17 additions and 0 deletions
|
|
@ -1277,6 +1277,23 @@ bi_word_node(bi_index idx)
|
|||
return (idx.value << 2) | idx.offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* Vertex ID and Instance ID are preloaded registers. Where they are preloaded
|
||||
* changed from Bifrost to Valhall. Provide helpers that smooth over the
|
||||
* architectural difference.
|
||||
*/
|
||||
static inline bi_index
|
||||
bi_vertex_id(bi_builder *b)
|
||||
{
|
||||
return bi_register((b->shader->arch >= 9) ? 60 : 61);
|
||||
}
|
||||
|
||||
static inline bi_index
|
||||
bi_instance_id(bi_builder *b)
|
||||
{
|
||||
return bi_register((b->shader->arch >= 9) ? 61 : 62);
|
||||
}
|
||||
|
||||
/* NIR passes */
|
||||
|
||||
bool bi_lower_divergent_indirects(nir_shader *shader, unsigned lanes);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue