diff options
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_camera.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_light.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index 8bd09247339..a23586a53a4 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -187,7 +187,7 @@ __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float ra } /* indicates ray should not receive any light, outside of the lens */ - if(len_squared(ray->D) == 0.0f) { + if(is_zero(ray->D)) { ray->t = 0.0f; return; } diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h index a4877acdc53..c07f1ffe5a3 100644 --- a/intern/cycles/kernel/kernel_light.h +++ b/intern/cycles/kernel/kernel_light.h @@ -492,7 +492,7 @@ __device void curve_segment_light_sample(KernelGlobals *kg, int prim, int object float r2 = P2.w; float3 tg = (float4_to_float3(P2) - float4_to_float3(P1)) / l; float3 xc = make_float3(tg.x * tg.z, tg.y * tg.z, -(tg.x * tg.x + tg.y * tg.y)); - if (dot(xc, xc) == 0.0f) + if (is_zero(xc)) xc = make_float3(tg.x * tg.y, -(tg.x * tg.x + tg.z * tg.z), tg.z * tg.y); xc = normalize(xc); float3 yc = cross(tg, xc); |