diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-07 13:01:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-07 13:02:44 +0300 |
commit | 1a7eca3c54179e831a98490fbf40ee518ae0b341 (patch) | |
tree | a82dcf420b4ddd7cac00359f498f7146c8c6ef6a /intern/cycles/kernel/geom | |
parent | 77b0b661dd524db47a2d79e5c0e4889a0c29aa44 (diff) |
Fix T46034: OpenCL kernel compilation error in latest buildbot
Simply expanded expression, so no float4->float3 conversion happens.
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle_intersect.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h index c30c71bbf1a..9cda0bc8546 100644 --- a/intern/cycles/kernel/geom/geom_triangle_intersect.h +++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h @@ -173,7 +173,11 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg, if(kernel_tex_fetch(__prim_visibility, triAddr) & visibility) #endif { - if(len_squared(cross(tri_b - tri_a, tri_c - tri_a)) < 1e-16f) { + float4 a = tri_b - tri_a, b = tri_c - tri_a; + if(len_squared(make_float3(a.y*b.z - a.z*b.y, + a.z*b.x - a.x*b.z, + a.x*b.y - a.y*b.x)) < 1e-16f) + { return false; } /* Normalize U, V, W, and T. */ |