[Bf-blender-cvs] [8491dba0c6b] blender2.7: Fix T60300: Cycles SSS render hanging with AMD OpenCL.

Brecht Van Lommel noreply at git.blender.org
Tue Jan 8 15:59:38 CET 2019


Commit: 8491dba0c6bb96f9785e27429c72315ba9660511
Author: Brecht Van Lommel
Date:   Tue Jan 8 15:35:54 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB8491dba0c6bb96f9785e27429c72315ba9660511

Fix T60300: Cycles SSS render hanging with AMD OpenCL.

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

M	intern/cycles/kernel/split/kernel_subsurface_scatter.h

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

diff --git a/intern/cycles/kernel/split/kernel_subsurface_scatter.h b/intern/cycles/kernel/split/kernel_subsurface_scatter.h
index c51246fbc90..08769fe303b 100644
--- a/intern/cycles/kernel/split/kernel_subsurface_scatter.h
+++ b/intern/cycles/kernel/split/kernel_subsurface_scatter.h
@@ -47,6 +47,11 @@ ccl_device_noinline bool kernel_split_branched_path_subsurface_indirect_light_it
 		if(!CLOSURE_IS_BSSRDF(sc->type))
 			continue;
 
+		/* Closure memory will be overwritten, so read required variables now. */
+		Bssrdf *bssrdf = (Bssrdf *)sc;
+		ClosureType bssrdf_type = sc->type;
+		float bssrdf_roughness = bssrdf->roughness;
+
 		/* set up random number generator */
 		if(branched_state->ss_next_sample == 0 && branched_state->next_hit == 0 &&
 		   branched_state->next_closure == 0 && branched_state->next_sample == 0)
@@ -110,10 +115,6 @@ ccl_device_noinline bool kernel_split_branched_path_subsurface_indirect_light_it
 				*bssrdf_sd = *sd; /* note: copy happens each iteration of inner loop, this is
 				                   * important as the indirect path will write into bssrdf_sd */
 
-				Bssrdf *bssrdf = (Bssrdf *)sc;
-				ClosureType bssrdf_type = sc->type;
-				float bssrdf_roughness = bssrdf->roughness;
-
 				LocalIntersection ss_isect_private = *ss_isect;
 				subsurface_scatter_multi_setup(kg,
 				                               &ss_isect_private,



More information about the Bf-blender-cvs mailing list