diff options
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/math.h | 7 | ||||
-rw-r--r-- | intern/cycles/util/math_float3.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/util/math.h b/intern/cycles/util/math.h index e7fc492733f..e4c7df6e44a 100644 --- a/intern/cycles/util/math.h +++ b/intern/cycles/util/math.h @@ -347,10 +347,15 @@ ccl_device_inline float smoothstep(float edge0, float edge1, float x) } #ifndef __KERNEL_CUDA__ -ccl_device_inline float saturate(float a) +ccl_device_inline float saturatef(float a) { return clamp(a, 0.0f, 1.0f); } +#else +ccl_device_inline float saturatef(float a) +{ + return __saturatef(a); +} #endif /* __KERNEL_CUDA__ */ ccl_device_inline int float_to_int(float f) diff --git a/intern/cycles/util/math_float3.h b/intern/cycles/util/math_float3.h index e780d7e0a7c..81550c5d03c 100644 --- a/intern/cycles/util/math_float3.h +++ b/intern/cycles/util/math_float3.h @@ -408,7 +408,7 @@ ccl_device_inline float3 project(const float3 v, const float3 v_proj) ccl_device_inline float3 saturate3(float3 a) { - return make_float3(saturate(a.x), saturate(a.y), saturate(a.z)); + return make_float3(saturatef(a.x), saturatef(a.y), saturatef(a.z)); } ccl_device_inline float3 normalize_len(const float3 a, ccl_private float *t) |