Blender Git Commit Log

Git Commits -> Revision 077116f

August 6, 2016, 03:22 (GMT)
Cycles: Redesign the buffer accesses of the denoising kernel.

At first, the denoising kernel just directly accessed the RenderBuffers.
However, that introduced some addressing complexity since the filter window might cover multiple tiles, each with a separate buffer.
Apart from the addressing overhead, this also made it pretty much impossible to SIMDify the CPU code.

When feature prefiltering was added, it changed the buffer addressing.
First, it copied the various parts of different buffers into one continuous array. Then, it operated directly on that array.
With these changes, the only thing the regular buffer addressing was still needed for was the color image.

Now, this commit also copies the color image into the prefiltered buffer. Therefore, it's not really just a prefiltered buffer anymore, but actually contains all the data needed to denoise.
This allows to redesign and clean up the kernel-device-interface, which is also done in this commit.

Advantages are:
- Lower addressing overhead - every pixel is only addressed once to copy the data to the denoising buffer, and once to store the final result - instead of hundreds of accesses per pixel when looping over the filter window.
- Lower code complexity - one array with standard scanline addressing makes the code a lot cleaner.
- For GPUs: More memory access coherence since the passes are stored in SoA layout instead of AoS (like the regular RenderBuffers are).
- For CPUs: Possibility to use SIMD instructions in the future due to the SoA layout.
The disadvantage is slightly higher memory usage - 22 floats per pixel instead of 16.

This commit doesn't include the CUDA changes yet.

Commit Details:

Full Hash: 077116f6570a4f22e6b1d0e875d8c68f518a3837
Parent Commit: b5c7734
Lines Changed: +320, -342

6 Modified Paths:

/intern/cycles/device/device_cpu.cpp (+184, -166) (Diff)
/intern/cycles/kernel/kernels/cpu/kernel_cpu.h (+8, -16) (Diff)
/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h (+10, -18) (Diff)
/intern/cycles/kernel/kernels/cuda/kernel.cu (+12, -22) (Diff)
/intern/cycles/kernel/kernel_filter.h (+101, -115) (Diff)
/intern/cycles/util/util_types.h (+5, -5) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021