Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 31 Aug 2018 10:30:19 +0000 (12:30 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 31 Aug 2018 10:30:19 +0000 (12:30 +0200)
intern/cycles/kernel/bvh/bvh_local.h
intern/cycles/kernel/bvh/obvh_local.h
intern/cycles/kernel/bvh/qbvh_local.h

index 8def71bc890b7b011a535047ca2fb86951af52d8..2b02f4527bb7d01e944bd96c2224d457ad6d3cb6 100644 (file)
@@ -73,10 +73,9 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
        int object = OBJECT_NONE;
        float isect_t = ray->t;
 
-       if(local_isect) {
+       if(local_isect != NULL) {
                local_isect->num_hits = 0;
        }
-
        kernel_assert((local_isect == NULL) == (max_hits == 0));
 
        const int object_flag = kernel_tex_fetch(__object_flag, local_object);
index 50bcfa79b6cae909282e7c7fda16bfc08ce19024..92143193a6a4b7090616893f0c45a129f60d560d 100644 (file)
@@ -50,7 +50,10 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
        int object = OBJECT_NONE;
        float isect_t = ray->t;
 
-       local_isect->num_hits = 0;
+       if(local_isect != NULL) {
+               local_isect->num_hits = 0;
+       }
+       kernel_assert((local_isect == NULL) == (max_hits == 0));
 
        const int object_flag = kernel_tex_fetch(__object_flag, local_object);
        if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
index 0dc0575556c18a274fd81e6cf9584586201aa2a9..ee3827de3098fab978132e308b23218f19b5fd4a 100644 (file)
@@ -59,10 +59,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
        int object = OBJECT_NONE;
        float isect_t = ray->t;
 
-       if(local_isect) {
+       if(local_isect != NULL) {
                local_isect->num_hits = 0;
        }
-
        kernel_assert((local_isect == NULL) == (max_hits == 0));
 
        const int object_flag = kernel_tex_fetch(__object_flag, local_object);