diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2017-11-10 06:34:14 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2017-11-30 09:37:08 +0300 |
commit | fa3d50af95fde76ef08590d2f86444f2f9fdca95 (patch) | |
tree | 516ea6cce9b6b3708389ad182a7dddf2974a1a10 /intern/cycles/device/device_denoising.h | |
parent | df7b9fa2eeb5908de4e1b3c2c6f7cf30329f1e3d (diff) |
Cycles: Improve denoising speed on GPUs with small tile sizes
Previously, the NLM kernels would be launched once per offset with one thread per pixel.
However, with the smaller tile sizes that are now feasible, there wasn't enough work to fully occupy GPUs which results in a significant slowdown.
Therefore, the kernels are now launched in a single call that handles all offsets at once.
This has two downsides: Memory accesses to accumulating buffers are now atomic, and more importantly, the temporary memory now has to be allocated for every shift at once, increasing the required memory.
On the other hand, of course, the smaller tiles significantly reduce the size of the memory.
The main bottleneck right now is the construction of the transformation - there is nothing to be parallelized there, one thread per pixel is the maximum.
I tried to parallelize the SVD implementation by storing the matrix in shared memory and launching one block per pixel, but that wasn't really going anywhere.
To make the new code somewhat readable, the handling of rectangular regions was cleaned up a bit and commented, it should be easier to understand what's going on now.
Also, some variables have been renamed to make the difference between buffer width and stride more apparent, in addition to some general style cleanup.
Diffstat (limited to 'intern/cycles/device/device_denoising.h')
-rw-r--r-- | intern/cycles/device/device_denoising.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/device/device_denoising.h b/intern/cycles/device/device_denoising.h index ec4e7933cdc..77a82d0ad04 100644 --- a/intern/cycles/device/device_denoising.h +++ b/intern/cycles/device/device_denoising.h @@ -94,7 +94,7 @@ public: device_ptr temporary_1_ptr; /* There two images are used as temporary storage. */ device_ptr temporary_2_ptr; - int4 filter_rect; + int4 filter_window; int4 buffer_params; int source_w; @@ -148,8 +148,9 @@ public: struct DenoiseBuffers { int pass_stride; int passes; - int w; + int stride; int h; + int width; device_only_memory<float> mem; DenoiseBuffers(Device *device) |