[Bf-blender-cvs] [cc95172] master: Cycles: Fix use of uninitialized variable in SSS

Sergey Sharybin noreply at git.blender.org
Wed Oct 12 12:19:58 CEST 2016


Commit: cc951726673e0e7e9969ce83f90efdabde289791
Author: Sergey Sharybin
Date:   Wed Oct 12 12:12:28 2016 +0200
Branches: master
https://developer.blender.org/rBcc951726673e0e7e9969ce83f90efdabde289791

Cycles: Fix use of uninitialized variable in SSS

When ray hits curve segment with SSS shader it was possible to have
uninitialized hit_P variable used for sampling.

Seems that was a reason of our headache of difference between AVX2
and SSE4 render results here, so now we can revert all the nasty
ifdef-ed inline policies.

===================================================================

M	intern/cycles/kernel/kernel_subsurface.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index 1575fa4..955aa8a 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -330,6 +330,10 @@ int subsurface_scatter_multi_intersect(
 			                                          verts);
 		}
 #endif  /* __OBJECT_MOTION__ */
+		else {
+			ss_isect->weight[hit] = make_float3(0.0f, 0.0f, 0.0f);
+			continue;
+		}
 
 		float3 hit_Ng = ss_isect->Ng[hit];
 		if(ss_isect->hits[hit].object != OBJECT_NONE) {




More information about the Bf-blender-cvs mailing list