[Bf-blender-cvs] [c48b1a4fe48] temp-cycles-denoising: Merge remote-tracking branch 'origin/master' into temp-cycles-denoising
Lukas Stockner
noreply at git.blender.org
Fri Apr 14 00:57:54 CEST 2017
Commit: c48b1a4fe48ba3d57e20d98a58babfb81b269dad
Author: Lukas Stockner
Date: Fri Apr 14 00:47:35 2017 +0200
Branches: temp-cycles-denoising
https://developer.blender.org/rBc48b1a4fe48ba3d57e20d98a58babfb81b269dad
Merge remote-tracking branch 'origin/master' into temp-cycles-denoising
===================================================================
===================================================================
diff --cc intern/cycles/util/util_math.h
index 6a0fb3500b7,77781ed4574..ecb3122e926
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@@ -1208,15 -1201,6 +1221,15 @@@ ccl_device_inline void print_int4(cons
printf("%s: %d %d %d %d\n", label, a.x, a.y, a.z, a.w);
}
+ccl_device_inline int4 load_int4(const int *v)
+{
+#ifdef __KERNEL_SSE__
- return _mm_loadu_si128((__m128i*)v);
++ return int4(_mm_loadu_si128((__m128i*)v));
+#else
+ return make_int4(v[0], v[1], v[2], v[3]);
+#endif
+}
+
#endif
/* Int/Float conversion */
@@@ -1522,44 -1506,6 +1535,19 @@@ ccl_device_inline float2 map_to_sphere(
return make_float2(u, v);
}
- ccl_device_inline int util_max_axis(float3 vec)
- {
- #ifdef __KERNEL_SSE__
- __m128 a = shuffle<0,0,1,1>(vec.m128);
- __m128 b = shuffle<1,2,2,1>(vec.m128);
- __m128 c = _mm_cmpgt_ps(a, b);
- int mask = _mm_movemask_ps(c) & 0x7;
- static const char tab[8] = {2, 2, 2, 0, 1, 2, 1, 0};
- return tab[mask];
- #else
- if(vec.x > vec.y) {
- if(vec.x > vec.z)
- return 0;
- else
- return 2;
- }
- else {
- if(vec.y > vec.z)
- return 1;
- else
- return 2;
- }
- #endif
- }
-
+ccl_device_inline float ensure_finite(float v)
+{
+ return isfinite_safe(v)? v : 0.0f;
+}
+
+ccl_device_inline float3 ensure_finite3(float3 v)
+{
+ if(!isfinite_safe(v.x)) v.x = 0.0;
+ if(!isfinite_safe(v.y)) v.y = 0.0;
+ if(!isfinite_safe(v.z)) v.z = 0.0;
+ return v;
+}
+
CCL_NAMESPACE_END
#endif /* __UTIL_MATH_H__ */
More information about the Bf-blender-cvs
mailing list