mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 02:00:12 +01:00
nir: Add a nir_def_first_component_read() helper
Similar to nir_def_last_component_read(). Just a little nicer than prodding at the bitmask of components read directly. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32888>
This commit is contained in:
parent
638fc5e472
commit
2f334e8baf
1 changed files with 6 additions and 0 deletions
|
|
@ -5102,6 +5102,12 @@ nir_component_mask_t nir_def_components_read(const nir_def *def);
|
|||
bool nir_def_all_uses_are_fsat(const nir_def *def);
|
||||
bool nir_def_all_uses_ignore_sign_bit(const nir_def *def);
|
||||
|
||||
static inline int
|
||||
nir_def_first_component_read(nir_def *def)
|
||||
{
|
||||
return (int)ffs(nir_def_components_read(def)) - 1;
|
||||
}
|
||||
|
||||
static inline int
|
||||
nir_def_last_component_read(nir_def *def)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue