diff --git a/intern/cycles/util/util_math_fast.h b/intern/cycles/util/util_math_fast.h index 1acceee22a5..c1a1be603f4 100644 --- a/intern/cycles/util/util_math_fast.h +++ b/intern/cycles/util/util_math_fast.h @@ -360,7 +360,7 @@ ccl_device float fast_log2f(float x) { /* NOTE: clamp to avoid special cases and make result "safe" from large * negative values/nans. */ - clamp(x, FLT_MIN, FLT_MAX); + x = clamp(x, FLT_MIN, FLT_MAX); unsigned bits = __float_as_uint(x); int exponent = (int)(bits >> 23) - 127; float f = __uint_as_float((bits & 0x007FFFFF) | 0x3f800000) - 1.0f; @@ -402,7 +402,7 @@ ccl_device float fast_logb(float x) { /* Don't bother with denormals. */ x = fabsf(x); - clamp(x, FLT_MIN, FLT_MAX); + x = clamp(x, FLT_MIN, FLT_MAX); unsigned bits = __float_as_uint(x); return (int)(bits >> 23) - 127; } @@ -410,7 +410,7 @@ ccl_device float fast_logb(float x) ccl_device float fast_exp2f(float x) { /* Clamp to safe range for final addition. */ - clamp(x, -126.0f, 126.0f); + x = clamp(x, -126.0f, 126.0f); /* Range reduction. */ int m = (int)x; x -= m; x = 1.0f - (1.0f - x); /* Crush denormals (does not affect max ulps!). */