Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-08 17:35:54 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-08 17:37:16 +0300
commit8491dba0c6bb96f9785e27429c72315ba9660511 (patch)
treebdcfc2e7fe56158262e3cfb02e5721e0da10891e /intern/cycles/kernel/split/kernel_subsurface_scatter.h
parent1e386d98ced39c181f7331550028474716ab48b3 (diff)
Fix T60300: Cycles SSS render hanging with AMD OpenCL.
Diffstat (limited to 'intern/cycles/kernel/split/kernel_subsurface_scatter.h')
-rw-r--r--intern/cycles/kernel/split/kernel_subsurface_scatter.h9
1 files changed, 5 insertions, 4 deletions
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,