From 00acf4b816abf632602ff15e47309b07b1fa7cfc Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 2 Sep 2014 23:26:29 +0200 Subject: Cleanup: Use function call and delete obsolete comment. --- intern/cycles/kernel/svm/svm_convert.h | 4 ++-- intern/cycles/util/util_math.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'intern') diff --git a/intern/cycles/kernel/svm/svm_convert.h b/intern/cycles/kernel/svm/svm_convert.h index 2503912c5c6..b221e0728ec 100644 --- a/intern/cycles/kernel/svm/svm_convert.h +++ b/intern/cycles/kernel/svm/svm_convert.h @@ -45,13 +45,13 @@ ccl_device void svm_node_convert(ShaderData *sd, float *stack, uint type, uint f } case NODE_CONVERT_VF: { float3 f = stack_load_float3(stack, from); - float g = (f.x + f.y + f.z)*(1.0f/3.0f); + float g = average(f); stack_store_float(stack, to, g); break; } case NODE_CONVERT_VI: { float3 f = stack_load_float3(stack, from); - int i = (int)((f.x + f.y + f.z)*(1.0f/3.0f)); + int i = (int)average(f); stack_store_int(stack, to, i); break; } diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 4ccb5f3e51c..1cd8883a5c7 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -842,7 +842,6 @@ ccl_device_inline float4 max(float4 a, float4 b) ccl_device_inline float4 select(const int4& mask, const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ - /* blendv is sse4, and apparently broken on vs2008 */ return _mm_or_ps(_mm_and_ps(_mm_cvtepi32_ps(mask), a), _mm_andnot_ps(_mm_cvtepi32_ps(mask), b)); /* todo: avoid cvt */ #else return make_float4((mask.x)? a.x: b.x, (mask.y)? a.y: b.y, (mask.z)? a.z: b.z, (mask.w)? a.w: b.w); -- cgit v1.2.3