mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
nir: Add fsat_signed opcode
Exists on later Mali. Equivalent to clamp(x, -1.0, 1.0) Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5102>
This commit is contained in:
parent
518909290b
commit
0aedce417a
1 changed files with 1 additions and 0 deletions
|
|
@ -200,6 +200,7 @@ unop("isign", tint, "(src0 == 0) ? 0 : ((src0 > 0) ? 1 : -1)")
|
|||
unop("iabs", tint, "(src0 < 0) ? -src0 : src0")
|
||||
unop("fabs", tfloat, "fabs(src0)")
|
||||
unop("fsat", tfloat, ("fmin(fmax(src0, 0.0), 1.0)"))
|
||||
unop("fsat_signed", tfloat, ("fmin(fmax(src0, -1.0), 1.0)"))
|
||||
unop("frcp", tfloat, "bit_size == 64 ? 1.0 / src0 : 1.0f / src0")
|
||||
unop("frsq", tfloat, "bit_size == 64 ? 1.0 / sqrt(src0) : 1.0f / sqrtf(src0)")
|
||||
unop("fsqrt", tfloat, "bit_size == 64 ? sqrt(src0) : sqrtf(src0)")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue