Fix T45333: Volume Scatter crash blender
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 13 Jul 2015 13:53:48 +0000 (18:53 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 13 Jul 2015 13:54:26 +0000 (18:54 +0500)
intern/cycles/kernel/geom/geom_qbvh_shadow.h
intern/cycles/kernel/geom/geom_qbvh_volume_all.h

index f79b2ed9f346d87f6a7bceb1d949e99892dbc711..dc37e6ecfa41eda36df5d60ed1ff6a41b86cf168 100644 (file)
@@ -58,6 +58,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
        Transform ob_tfm;
 #endif
 
+       *num_hits = 0;
+       isect_array->t = tmax;
+
 #ifndef __KERNEL_SSE41__
        if(!isfinite(P.x)) {
                return false;
@@ -68,9 +71,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
        int num_hits_in_instance = 0;
 #endif
 
-       *num_hits = 0;
-       isect_array->t = tmax;
-
        ssef tnear(0.0f), tfar(tmax);
        sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z));
 
index d5131919944f15529ba3b5854cea531edd10a167..056ca9a1ad95405aeb7ea6dc8e425852fec46f76 100644 (file)
@@ -60,6 +60,9 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
        Transform ob_tfm;
 #endif
 
+       uint num_hits = 0;
+       isect_array->t = tmax;
+
 #ifndef __KERNEL_SSE41__
        if(!isfinite(P.x)) {
                return false;
@@ -70,9 +73,6 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
        int num_hits_in_instance = 0;
 #endif
 
-       uint num_hits = 0;
-       isect_array->t = tmax;
-
        ssef tnear(0.0f), tfar(isect_t);
        sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z));