mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
nir/spirv/glsl450: Add a helper for doing fclamp().
This commit is contained in:
parent
0f801752f2
commit
227e250005
1 changed files with 7 additions and 0 deletions
|
|
@ -41,6 +41,13 @@ build_length(nir_builder *b, nir_ssa_def *vec)
|
|||
}
|
||||
}
|
||||
|
||||
static inline nir_ssa_def *
|
||||
build_fclamp(nir_builder *b,
|
||||
nir_ssa_def *x, nir_ssa_def *min_val, nir_ssa_def *max_val)
|
||||
{
|
||||
return nir_fmin(b, nir_fmax(b, x, min_val), max_val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return e^x.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue