From 400e6f37b80dde3910b8d7a9d5e619b778a1c1ff Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 23 Aug 2017 03:57:27 +0200 Subject: 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. --- intern/cycles/kernel/kernel_path_surface.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'intern/cycles/kernel/kernel_path_surface.h') diff --git a/intern/cycles/kernel/kernel_path_surface.h b/intern/cycles/kernel/kernel_path_surface.h index e798fcc6a2c..7b566b01b04 100644 --- a/intern/cycles/kernel/kernel_path_surface.h +++ b/intern/cycles/kernel/kernel_path_surface.h @@ -150,7 +150,7 @@ ccl_device bool kernel_branched_path_surface_bounce( int num_samples, ccl_addr_space float3 *throughput, ccl_addr_space PathState *state, - PathRadiance *L, + PathRadianceState *L_state, ccl_addr_space Ray *ray, float sum_sample_weight) { @@ -170,7 +170,7 @@ ccl_device bool kernel_branched_path_surface_bounce( return false; /* modify throughput */ - path_radiance_bsdf_bounce(L, throughput, &bsdf_eval, bsdf_pdf, state->bounce, label); + path_radiance_bsdf_bounce(kg, L_state, throughput, &bsdf_eval, bsdf_pdf, state->bounce, label); #ifdef __DENOISING_FEATURES__ state->denoising_feature_weight *= sc->sample_weight / (sum_sample_weight * num_samples); @@ -271,7 +271,7 @@ ccl_device bool kernel_path_surface_bounce(KernelGlobals *kg, ShaderData *sd, ccl_addr_space float3 *throughput, ccl_addr_space PathState *state, - PathRadiance *L, + PathRadianceState *L_state, ccl_addr_space Ray *ray) { /* no BSDF? we can stop here */ @@ -292,7 +292,7 @@ ccl_device bool kernel_path_surface_bounce(KernelGlobals *kg, return false; /* modify throughput */ - path_radiance_bsdf_bounce(L, throughput, &bsdf_eval, bsdf_pdf, state->bounce, label); + path_radiance_bsdf_bounce(kg, L_state, throughput, &bsdf_eval, bsdf_pdf, state->bounce, label); /* set labels */ if(!(label & LABEL_TRANSPARENT)) { -- cgit v1.2.3