From ab3a6e050c856345d10f8e36155913288559e4dc Mon Sep 17 00:00:00 2001 From: Patrick Mours Date: Mon, 17 Feb 2020 16:15:56 +0100 Subject: Fix artifacts with Cycles viewport denoising when rendering with multiple CUDA devices Rendering with multiple CUDA devices but denoising with OptiX caused parts of the image to go missing at the start while the resolution was scaled. This is because the copy operation in `MultiDevice::map_neighbor_tiles` which slices the copy across all devices would slice based on the full resolution and not the scaled one and therefore copy incorrect data between devices. Since this is not the recommended way of using viewport denoising anyway, simply avoid those incorrect copies for now by disabling denoising while the resolution is scaled. Doing both rendering and denoising with OptiX is not affected by this, since it avoids those copies altogether anyway. --- intern/cycles/render/session.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index b41844cb132..acf9ca68889 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -1115,6 +1115,13 @@ void Session::denoise() return; } + /* Cannot denoise with resolution divider and separate denoising devices. + * It breaks the copy in 'MultiDevice::map_neighbor_tiles' (which operates on the full buffer + * dimensions and not the scaled ones). */ + if (!params.device.denoising_devices.empty() && tile_manager.state.resolution_divider > 1) { + return; + } + /* Add separate denoising task. */ DeviceTask task(DeviceTask::DENOISE); -- cgit v1.2.3