The OptiX denoiser can be a great help when rendering in the viewport, since it is really fast and needs few samples to produce convincing results. This patch therefore adds support for using any Cycles denoiser in the viewport also (both the OptiX and NLM ones).
Unfortunately this sounds easier on paper than it actually is, because the current architecture didn't handle this case at all and things fell apart with multiple GPUs because the multi-GPU implementation made various assumptions about the tile buffers, that were not met in viewport rendering.
This patch therefore extends the tile manager to properly handle tile neighbors even if those tiles all reside in one big buffer (as is the case in the viewport). It also changes that big buffer to be a 2D image, so that the multi-device copy code can be re-used (which already supports sliced downloads via mem_copy_from). Finally the session synchronization code is modified to synchronize denoising settings in viewport rendering (which means keeping track of the view layer there too) instead of just doing so for batch rendering.