Cycles: Reuse existing buffer in the NLM denoising kernels on CPU

This commit is contained in:
Lukas Stockner 2018-10-08 22:17:06 +02:00
parent 15e9d80375
commit 0234de7d85
2 changed files with 2 additions and 3 deletions

View File

@ -475,7 +475,6 @@ public:
float *blurDifference = temporary_mem;
float *difference = temporary_mem + task->buffer.pass_stride;
float *weightAccum = temporary_mem + 2*task->buffer.pass_stride;
float *temp_image = temporary_mem + 3*task->buffer.pass_stride;
memset(weightAccum, 0, sizeof(float)*w*h);
memset((float*) out_ptr, 0, sizeof(float)*w*h);
@ -500,7 +499,7 @@ public:
filter_nlm_update_output_kernel()(dx, dy,
blurDifference,
(float*) image_ptr,
temp_image,
difference,
(float*) out_ptr,
weightAccum,
local_rect,

View File

@ -107,7 +107,7 @@ void DenoisingTask::setup_denoising_buffer()
num_layers = 2*num_shifts + 1;
}
else {
num_layers = 4;
num_layers = 3;
}
/* Allocate two layers per shift as well as one for the weight accumulation. */
buffer.temporary_mem.alloc_to_device(num_layers * buffer.pass_stride);