diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-24 15:32:56 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-24 15:32:56 +0300 |
commit | 436d1b4e901a980be743e2ed94872d98b59f27d2 (patch) | |
tree | 9245b2b5dc6bc15d310d6b90bad6d9f6d55d330a /intern/cycles/util | |
parent | 1fb263700672f7a26d4e99a75aedbf258be5d173 (diff) |
Cycles: FIx issue with -0 being considered a non-finite value
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_math.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 0d27ee06fa7..348e652eadd 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -224,7 +224,7 @@ ccl_device_inline bool isfinite_safe(float f) { /* By IEEE 754 rule, 2*Inf equals Inf */ unsigned int x = __float_as_uint(f); - return (f == f) && (x == 0 || (f != 2.0f*f)) && !((x << 1) > 0xff000000u); + return (f == f) && (x == 0 || x == (1 << 31) || (f != 2.0f*f)) && !((x << 1) > 0xff000000u); } ccl_device_inline float ensure_finite(float v) |