diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-23 04:57:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-09-28 16:18:43 +0300 |
commit | 400e6f37b80dde3910b8d7a9d5e619b778a1c1ff (patch) | |
tree | 61ecd35d2231c0f7585dc0148638de00819638b5 /intern/cycles/kernel/kernel_path.h | |
parent | 9ddee885aea4d026bb0409a51a137706c95d318b (diff) |
Cycles: reduce subsurface stack memory usage.
This is done by storing only a subset of PathRadiance, and by storing
direct light immediately in the main PathRadiance. Saves about 10% of
CUDA stack memory, and simplifies subsurface indirect ray code.
Diffstat (limited to 'intern/cycles/kernel/kernel_path.h')
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index d43d6374c13..793fede0deb 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -222,7 +222,7 @@ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume( kernel_volume_decoupled_free(kg, &volume_segment); if(result == VOLUME_PATH_SCATTERED) { - if(kernel_path_volume_bounce(kg, sd, throughput, state, L, ray)) + if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray)) return VOLUME_PATH_SCATTERED; else return VOLUME_PATH_MISSED; @@ -244,7 +244,7 @@ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume( kernel_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L); /* indirect light bounce */ - if(kernel_path_volume_bounce(kg, sd, throughput, state, L, ray)) + if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray)) return VOLUME_PATH_SCATTERED; else return VOLUME_PATH_MISSED; @@ -519,7 +519,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, } #endif /* defined(__EMISSION__) */ - if(!kernel_path_surface_bounce(kg, sd, &throughput, state, L, ray)) + if(!kernel_path_surface_bounce(kg, sd, &throughput, state, &L->state, ray)) break; } } @@ -648,13 +648,11 @@ ccl_device_forceinline void kernel_path_integrate( kernel_path_surface_connect_light(kg, &sd, emission_sd, throughput, state, L); /* compute direct lighting and next bounce */ - if(!kernel_path_surface_bounce(kg, &sd, &throughput, state, L, ray)) + if(!kernel_path_surface_bounce(kg, &sd, &throughput, state, &L->state, ray)) break; } #ifdef __SUBSURFACE__ - kernel_path_subsurface_accum_indirect(&ss_indirect, L); - /* Trace indirect subsurface rays by restarting the loop. this uses less * stack memory than invoking kernel_path_indirect. */ |