diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-09-21 18:46:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-02-08 16:00:48 +0300 |
commit | dde40989f34634f43fb561416728c438dfb62f0b (patch) | |
tree | 024268c5b5dbc9a858850bb7a361570df3b042fa /intern/cycles/kernel/kernel_shadow.h | |
parent | 7447950bc3a3b11f0f1e0fd55df2031dbd3c0be2 (diff) |
Cycles: Store shadow intersections in the kernel globals
Seems CUDA failed to de-duplicate the array across multiple inlined
versions of the shadow_blocked(). Helped it a bit with that now.
Gives about 100MB memory improvement on a scenes after previous
commit and brings up memory "regression" to only 100MB comparing to
the master branch now.
Diffstat (limited to 'intern/cycles/kernel/kernel_shadow.h')
-rw-r--r-- | intern/cycles/kernel/kernel_shadow.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_shadow.h b/intern/cycles/kernel/kernel_shadow.h index 05a6c7d1827..e69eac6ab83 100644 --- a/intern/cycles/kernel/kernel_shadow.h +++ b/intern/cycles/kernel/kernel_shadow.h @@ -109,8 +109,12 @@ ccl_device_inline bool shadow_blocked_all(KernelGlobals *kg, /* Intersect to find an opaque surface, or record all transparent * surface hits. */ +#ifdef __KERNEL_CUDA__ + Intersection *hits = kg->hits_stack; +#else Intersection hits_stack[SHADOW_STACK_MAX_HITS]; Intersection *hits = hits_stack; +#endif const int transparent_max_bounce = kernel_data.integrator.transparent_max_bounce; uint max_hits = transparent_max_bounce - state->transparent_bounce - 1; #ifndef __KERNEL_GPU__ @@ -247,6 +251,7 @@ ccl_device_noinline bool shadow_blocked_stepped(KernelGlobals *kg, for(;;) { if(bounce >= kernel_data.integrator.transparent_max_bounce) { return true; + } if(!scene_intersect(kg, *ray, PATH_RAY_SHADOW_TRANSPARENT, |