diff options
author | Patrick Mours <pmours@nvidia.com> | 2019-08-25 19:11:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-26 11:26:53 +0300 |
commit | fd52dc58ddea642b7162b01538c0c6c48abb0507 (patch) | |
tree | 21df79cee59c14c0cada5c4bc49da3824d4c8a4b /intern/cycles/kernel/kernel_path.h | |
parent | f491c23f1e104998752380b930307e7abc4597b3 (diff) |
Cycles: GPU code generation optimizations for direct lighting
Use a single loop to iterate over all lights, reducing divergence and amount
of code to generate. Moving ray intersection calls out of conditionals will
also help the Optix compiler.
Ref D5363
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 1e8d54a23bf..63be0a7f505 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -474,12 +474,10 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, # endif /* __SUBSURFACE__ */ # if defined(__EMISSION__) - if (kernel_data.integrator.use_direct_light) { - int all = (kernel_data.integrator.sample_all_lights_indirect) || - (state->flag & PATH_RAY_SHADOW_CATCHER); - kernel_branched_path_surface_connect_light( - kg, sd, emission_sd, state, throughput, 1.0f, L, all); - } + int all = (kernel_data.integrator.sample_all_lights_indirect) || + (state->flag & PATH_RAY_SHADOW_CATCHER); + kernel_branched_path_surface_connect_light( + kg, sd, emission_sd, state, throughput, 1.0f, L, all); # endif /* defined(__EMISSION__) */ # ifdef __VOLUME__ |