Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix minor issue with fmath's OIIO::clamp (#2594)
OIIO::clamp had the property that if `val <= low`, it sets `low`. But actually, when `val == low`, we want to use `val`, not `low`. This may seem like the same thing, and it is for ordinary types. But OSL uses this clamp template for "dual" types (implementing automatic differentiation), and it causes a case where `val == low` but `val` carries derivatives that we want preserved, not written over by the 0-derivatives of the fixed `low` value. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information