mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 13:40:16 +01:00
nir: add nir_fisnan helper function
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
This commit is contained in:
parent
c9d60547ef
commit
bf9c1699cd
1 changed files with 7 additions and 1 deletions
|
|
@ -53,10 +53,16 @@ nir_get_texture_lod(nir_builder *b, nir_tex_instr *tex);
|
|||
nir_ssa_def *
|
||||
nir_get_texture_size(nir_builder *b, nir_tex_instr *tex);
|
||||
|
||||
static inline nir_ssa_def *
|
||||
nir_fisnan(nir_builder *b, nir_ssa_def *x)
|
||||
{
|
||||
return nir_fneu(b, x, x);
|
||||
}
|
||||
|
||||
static inline nir_ssa_def *
|
||||
nir_nan_check2(nir_builder *b, nir_ssa_def *x, nir_ssa_def *y, nir_ssa_def *res)
|
||||
{
|
||||
return nir_bcsel(b, nir_fneu(b, x, x), x, nir_bcsel(b, nir_fneu(b, y, y), y, res));
|
||||
return nir_bcsel(b, nir_fisnan(b, x), x, nir_bcsel(b, nir_fisnan(b, y), y, res));
|
||||
}
|
||||
|
||||
static inline nir_ssa_def *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue