diff options
Diffstat (limited to 'intern/cycles/kernel/geom/geom_object.h')
-rw-r--r-- | intern/cycles/kernel/geom/geom_object.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/intern/cycles/kernel/geom/geom_object.h b/intern/cycles/kernel/geom/geom_object.h index 3aa68e1f84e..614e2e3b92b 100644 --- a/intern/cycles/kernel/geom/geom_object.h +++ b/intern/cycles/kernel/geom/geom_object.h @@ -411,25 +411,10 @@ ccl_device float3 particle_angular_velocity(KernelGlobals *kg, int particle) ccl_device_inline float3 bvh_clamp_direction(float3 dir) { - /* clamp absolute values by exp2f(-80.0f) to avoid division by zero when calculating inverse - * direction */ -#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) - const ssef oopes(8.271806E-25f, 8.271806E-25f, 8.271806E-25f, 0.0f); - const ssef mask = _mm_cmpgt_ps(fabs(dir), oopes); - const ssef signdir = signmsk(dir.m128) | oopes; -# ifndef __KERNEL_AVX__ - ssef res = mask & ssef(dir); - res = _mm_or_ps(res, _mm_andnot_ps(mask, signdir)); -# else - ssef res = _mm_blendv_ps(signdir, dir, mask); -# endif - return float3(res); -#else /* __KERNEL_SSE__ && __KERNEL_SSE2__ */ const float ooeps = 8.271806E-25f; return make_float3((fabsf(dir.x) > ooeps) ? dir.x : copysignf(ooeps, dir.x), (fabsf(dir.y) > ooeps) ? dir.y : copysignf(ooeps, dir.y), (fabsf(dir.z) > ooeps) ? dir.z : copysignf(ooeps, dir.z)); -#endif /* __KERNEL_SSE__ && __KERNEL_SSE2__ */ } ccl_device_inline float3 bvh_inverse_direction(float3 dir) @@ -457,38 +442,6 @@ ccl_device_inline float bvh_instance_push( return t; } -#ifdef __QBVH__ -/* Same as above, but optimized for QBVH scene intersection, - * which needs to modify two max distances. - * - * TODO(sergey): Investigate if passing NULL instead of t1 gets optimized - * so we can avoid having this duplication. - */ -ccl_device_inline void qbvh_instance_push(KernelGlobals *kg, - int object, - const Ray *ray, - float3 *P, - float3 *dir, - float3 *idir, - float *t, - float *t1) -{ - Transform tfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); - - *P = transform_point(&tfm, ray->P); - - float len; - *dir = bvh_clamp_direction(normalize_len(transform_direction(&tfm, ray->D), &len)); - *idir = bvh_inverse_direction(*dir); - - if (*t != FLT_MAX) - *t *= len; - - if (*t1 != -FLT_MAX) - *t1 *= len; -} -#endif - /* Transorm ray to exit static object in BVH */ ccl_device_inline float bvh_instance_pop( @@ -551,39 +504,6 @@ ccl_device_inline float bvh_instance_motion_push(KernelGlobals *kg, return t; } -# ifdef __QBVH__ -/* Same as above, but optimized for QBVH scene intersection, - * which needs to modify two max distances. - * - * TODO(sergey): Investigate if passing NULL instead of t1 gets optimized - * so we can avoid having this duplication. - */ -ccl_device_inline void qbvh_instance_motion_push(KernelGlobals *kg, - int object, - const Ray *ray, - float3 *P, - float3 *dir, - float3 *idir, - float *t, - float *t1, - Transform *itfm) -{ - object_fetch_transform_motion_test(kg, object, ray->time, itfm); - - *P = transform_point(itfm, ray->P); - - float len; - *dir = bvh_clamp_direction(normalize_len(transform_direction(itfm, ray->D), &len)); - *idir = bvh_inverse_direction(*dir); - - if (*t != FLT_MAX) - *t *= len; - - if (*t1 != -FLT_MAX) - *t1 *= len; -} -# endif - /* Transorm ray to exit motion blurred object in BVH */ ccl_device_inline float bvh_instance_motion_pop(KernelGlobals *kg, |