Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2015-12-01 15:53:29 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2015-12-01 15:53:29 +0300
commit8512e284a001fdf464488112f4d19d598d37342b (patch)
tree9542a88495727a21d0293f1ad13264bc8210e198 /intern
parentb2e36dcd7db55fada5c500e95a0a1c9c9ab82fcb (diff)
Fix T46906: Cycles syntax error while compiling OpenCL kernels
The safe normalization was using a float as a condition, now the intended non-zero test is explicit.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/util/util_math.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 7d6dfd34e0e..4a676d0d7b5 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -351,7 +351,7 @@ ccl_device_inline float2 normalize_len(const float2 a, float *t)
ccl_device_inline float2 safe_normalize(const float2 a)
{
float t = len(a);
- return (t)? a/t: a;
+ return (t != 0.0f)? a/t: a;
}
ccl_device_inline bool operator==(const float2 a, const float2 b)
@@ -553,7 +553,7 @@ ccl_device_inline float3 normalize_len(const float3 a, float *t)
ccl_device_inline float3 safe_normalize(const float3 a)
{
float t = len(a);
- return (t)? a/t: a;
+ return (t != 0.0f)? a/t: a;
}
#ifndef __KERNEL_OPENCL__
@@ -866,7 +866,7 @@ ccl_device_inline float4 normalize(const float4 a)
ccl_device_inline float4 safe_normalize(const float4 a)
{
float t = len(a);
- return (t)? a/t: a;
+ return (t != 0.0f)? a/t: a;
}
ccl_device_inline float4 min(float4 a, float4 b)