diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-09-29 20:20:11 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-09-29 21:25:16 +0300 |
commit | 19785cb022f7b279dd78f2c533712f26fc0bc629 (patch) | |
tree | 11b2867a796f409ce1078c195f79f348a3955e88 /intern/cycles/integrator | |
parent | 22c61e80605079141293c749de37cbe85bf2b33b (diff) |
Fix Cycles CPU performance regression after recent change for intersections size
This struct is much bigger now, and does not actually need to be fully zero
initialized.
Diffstat (limited to 'intern/cycles/integrator')
-rw-r--r-- | intern/cycles/integrator/path_trace_work_cpu.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/intern/cycles/integrator/path_trace_work_cpu.cpp b/intern/cycles/integrator/path_trace_work_cpu.cpp index b9a33b64051..14658d4d1ce 100644 --- a/intern/cycles/integrator/path_trace_work_cpu.cpp +++ b/intern/cycles/integrator/path_trace_work_cpu.cpp @@ -19,6 +19,8 @@ #include "device/cpu/kernel.h" #include "device/device.h" +#include "kernel/kernel_path_state.h" + #include "integrator/pass_accessor_cpu.h" #include "render/buffers.h" @@ -116,13 +118,17 @@ void PathTraceWorkCPU::render_samples_full_pipeline(KernelGlobals *kernel_global const KernelWorkTile &work_tile, const int samples_num) { - const bool has_shadow_catcher = device_scene_->data.integrator.has_shadow_catcher; const bool has_bake = device_scene_->data.bake.use; - IntegratorStateCPU integrator_states[2] = {}; + IntegratorStateCPU integrator_states[2]; IntegratorStateCPU *state = &integrator_states[0]; - IntegratorStateCPU *shadow_catcher_state = &integrator_states[1]; + IntegratorStateCPU *shadow_catcher_state = nullptr; + + if (device_scene_->data.integrator.has_shadow_catcher) { + shadow_catcher_state = &integrator_states[1]; + path_state_init_queues(kernel_globals, shadow_catcher_state); + } KernelWorkTile sample_work_tile = work_tile; float *render_buffer = buffers_->buffer.data(); @@ -147,7 +153,7 @@ void PathTraceWorkCPU::render_samples_full_pipeline(KernelGlobals *kernel_global kernels_.integrator_megakernel(kernel_globals, state, render_buffer); - if (has_shadow_catcher) { + if (shadow_catcher_state) { kernels_.integrator_megakernel(kernel_globals, shadow_catcher_state, render_buffer); } |