Cycles: Fix uninitialized number of hits
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 20 Feb 2019 22:15:21 +0000 (23:15 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 20 Feb 2019 22:20:07 +0000 (23:20 +0100)
Was happening when looking for all intersections for transparent shadow rays
in the case the ray is degenerate.

Still quesitonable whether we should consider this a transparent or opaque
configuraiton. Ideally, we should prevent such rays from happening, but that
is another vector of debugging.

intern/cycles/kernel/bvh/bvh.h

index 284b1e9..d123c6d 100644 (file)
@@ -334,6 +334,7 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg,
        PROFILING_INIT(kg, PROFILING_INTERSECT_SHADOW_ALL);
 
        if(!scene_intersect_valid(ray)) {
+               *num_hits = 0;
                return false;
        }
 #  ifdef __EMBREE__