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:
authorHristo Gueorguiev <prem.nirved@gmail.com>2017-03-08 18:26:39 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-03-09 19:09:37 +0300
commite8b5a5bf5b63ef1c8980f8da95be32cad4d2cf0e (patch)
tree4288c161ebb3eeacaf53d620e20c028e3df33e17 /intern/cycles/kernel/kernel_shadow.h
parent57e26627c485baab63e108821b2712d5e234ae7c (diff)
Cycles: Speedup transparent shadows in split kernel
This commit enables record-all transparent shadows rays. Perfromance results: R9 290 render time (without synchronization), seconds Before After Change BMW 261.5 262.5 +0.4 % Classroom 869.6 867.3 -0.3 % Fishy Cat 657.4 639.8 -2.7 % Koro 1909.8 692.8 -63.7 % Pabellon Barcelona 1633.3 1238.0 -24.2 % Pabellon Barcelona(*) 1158.1 903.8 -22.0 % (*) without glossy connected to volume
Diffstat (limited to 'intern/cycles/kernel/kernel_shadow.h')
-rw-r--r--intern/cycles/kernel/kernel_shadow.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/cycles/kernel/kernel_shadow.h b/intern/cycles/kernel/kernel_shadow.h
index 68a7ccfd903..4efc6c8118d 100644
--- a/intern/cycles/kernel/kernel_shadow.h
+++ b/intern/cycles/kernel/kernel_shadow.h
@@ -152,7 +152,13 @@ ccl_device bool shadow_blocked_transparent_all_loop(KernelGlobals *kg,
int bounce = state->transparent_bounce;
Intersection *isect = hits;
# ifdef __VOLUME__
- PathState ps = *state;
+# ifdef __SPLIT_KERNEL__
+ ccl_addr_space PathState *ps = &kernel_split_state.state_shadow[ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0)];
+# else
+ PathState ps_object;
+ PathState *ps = &ps_object;
+# endif
+ *ps = *state;
# endif
sort_intersections(hits, num_hits);
for(int hit = 0; hit < num_hits; hit++, isect++) {
@@ -171,7 +177,7 @@ ccl_device bool shadow_blocked_transparent_all_loop(KernelGlobals *kg,
shadow_sd,
state,
#ifdef __VOLUME__
- &ps,
+ ps,
#endif
isect,
ray,
@@ -188,8 +194,8 @@ ccl_device bool shadow_blocked_transparent_all_loop(KernelGlobals *kg,
}
# ifdef __VOLUME__
/* Attenuation for last line segment towards light. */
- if(ps.volume_stack[0].shader != SHADER_NONE) {
- kernel_volume_shadow(kg, shadow_sd, &ps, ray, &throughput);
+ if(ps->volume_stack[0].shader != SHADER_NONE) {
+ kernel_volume_shadow(kg, shadow_sd, ps, ray, &throughput);
}
# endif
*shadow = throughput;
@@ -214,7 +220,10 @@ ccl_device bool shadow_blocked_transparent_all(KernelGlobals *kg,
uint max_hits,
float3 *shadow)
{
-# ifdef __KERNEL_CUDA__
+# ifdef __SPLIT_KERNEL__
+ Intersection hits_[SHADOW_STACK_MAX_HITS];
+ Intersection *hits = &hits_[0];
+# elif defined(__KERNEL_CUDA__)
Intersection *hits = kg->hits_stack;
# else
Intersection hits_stack[SHADOW_STACK_MAX_HITS];