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:
authorMai Lavelle <mai.lavelle@gmail.com>2017-11-09 08:49:15 +0300
committerMai Lavelle <mai.lavelle@gmail.com>2017-11-09 09:04:06 +0300
commit087331c495b04ebd37903c0dc0e46262354cf026 (patch)
treeef63fbab4859021585d002f4782840d6e91365a2 /intern/cycles/kernel/split/kernel_branched.h
parent6febe6e725381456f39966e0f685da67cfe52bce (diff)
Cycles: Replace __MAX_CLOSURE__ build option with runtime integrator variable
Goal is to reduce OpenCL kernel recompilations. Currently viewport renders are still set to use 64 closures as this seems to be faster and we don't want to cause a performance regression there. Needs to be investigated. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2775
Diffstat (limited to 'intern/cycles/kernel/split/kernel_branched.h')
-rw-r--r--intern/cycles/kernel/split/kernel_branched.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/intern/cycles/kernel/split/kernel_branched.h b/intern/cycles/kernel/split/kernel_branched.h
index 2313feac089..6456636caaa 100644
--- a/intern/cycles/kernel/split/kernel_branched.h
+++ b/intern/cycles/kernel/split/kernel_branched.h
@@ -30,10 +30,14 @@ ccl_device_inline void kernel_split_branched_path_indirect_loop_init(KernelGloba
BRANCHED_STORE(path_state);
BRANCHED_STORE(throughput);
BRANCHED_STORE(ray);
- BRANCHED_STORE(sd);
BRANCHED_STORE(isect);
BRANCHED_STORE(ray_state);
+ branched_state->sd = *kernel_split_sd(sd, ray_index);
+ for(int i = 0; i < branched_state->sd.num_closure; i++) {
+ branched_state->sd.closure[i] = kernel_split_sd(sd, ray_index)->closure[i];
+ }
+
#undef BRANCHED_STORE
/* set loop counters to intial position */
@@ -53,10 +57,14 @@ ccl_device_inline void kernel_split_branched_path_indirect_loop_end(KernelGlobal
BRANCHED_RESTORE(path_state);
BRANCHED_RESTORE(throughput);
BRANCHED_RESTORE(ray);
- BRANCHED_RESTORE(sd);
BRANCHED_RESTORE(isect);
BRANCHED_RESTORE(ray_state);
+ *kernel_split_sd(sd, ray_index) = branched_state->sd;
+ for(int i = 0; i < branched_state->sd.num_closure; i++) {
+ kernel_split_sd(sd, ray_index)->closure[i] = branched_state->sd.closure[i];
+ }
+
#undef BRANCHED_RESTORE
/* leave indirect loop */