mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-22 12:00:28 +01:00
nir: add nir_alu_src_rewrite_scalar helper
this is a little annoying. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mel Henning <mhenning@darkrefraction.com> Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36147>
This commit is contained in:
parent
59ffaf9222
commit
22b37c16c8
1 changed files with 7 additions and 0 deletions
|
|
@ -4378,6 +4378,13 @@ nir_src_rewrite(nir_src *src, nir_def *new_ssa)
|
|||
list_addtail(&src->use_link, &new_ssa->uses);
|
||||
}
|
||||
|
||||
static inline void
|
||||
nir_alu_src_rewrite_scalar(nir_alu_src *alu, nir_scalar s)
|
||||
{
|
||||
nir_src_rewrite(&alu->src, s.def);
|
||||
alu->swizzle[0] = (uint8_t)s.comp;
|
||||
}
|
||||
|
||||
/** Initialize a nir_src
|
||||
*
|
||||
* This is almost never the helper you want to use. This helper assumes that
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue