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
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r--intern/cycles/kernel/svm/svm_color_util.h8
-rw-r--r--intern/cycles/kernel/svm/svm_noise.h7
2 files changed, 12 insertions, 3 deletions
diff --git a/intern/cycles/kernel/svm/svm_color_util.h b/intern/cycles/kernel/svm/svm_color_util.h
index 0f571eb7253..3a6a5ba782f 100644
--- a/intern/cycles/kernel/svm/svm_color_util.h
+++ b/intern/cycles/kernel/svm/svm_color_util.h
@@ -255,7 +255,13 @@ ccl_device float3 svm_mix_linear(float t, float3 col1, float3 col2)
ccl_device float3 svm_mix_clamp(float3 col)
{
- return saturate3(col);
+ float3 outcol = col;
+
+ outcol.x = saturate(col.x);
+ outcol.y = saturate(col.y);
+ outcol.z = saturate(col.z);
+
+ return outcol;
}
ccl_device_noinline_cpu float3 svm_mix(NodeMix type, float fac, float3 c1, float3 c2)
diff --git a/intern/cycles/kernel/svm/svm_noise.h b/intern/cycles/kernel/svm/svm_noise.h
index e03ffa2bc9d..dd375af27e5 100644
--- a/intern/cycles/kernel/svm/svm_noise.h
+++ b/intern/cycles/kernel/svm/svm_noise.h
@@ -181,9 +181,9 @@ ccl_device_inline ssef scale3_sse(const ssef &result)
}
#endif
+#ifndef __KERNEL_SSE2__
ccl_device_noinline_cpu float perlin(float x, float y, float z)
{
-#ifndef __KERNEL_SSE2__
int X;
float fx = floorfrac(x, &X);
int Y;
@@ -217,7 +217,10 @@ ccl_device_noinline_cpu float perlin(float x, float y, float z)
/* can happen for big coordinates, things even out to 0.0 then anyway */
return (isfinite(r)) ? r : 0.0f;
+}
#else
+ccl_device_noinline float perlin(float x, float y, float z)
+{
ssef xyz = ssef(x, y, z, 0.0f);
ssei XYZ;
@@ -255,8 +258,8 @@ ccl_device_noinline_cpu float perlin(float x, float y, float z)
ssef rinfmask = ((r & infmask) == infmask).m128; // 0xffffffff if r is inf/-inf/nan else 0
ssef rfinite = andnot(rinfmask, r); // 0 if r is inf/-inf/nan else r
return extract<0>(rfinite);
-#endif
}
+#endif
/* perlin noise in range 0..1 */
ccl_device float noise(float3 p)