diff options
author | Patrick Mours <pmours@nvidia.com> | 2022-08-12 16:49:30 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2022-08-12 17:00:54 +0300 |
commit | 79787bf8e1e1d766e34dc6f8c5eda2efcceaa6cc (patch) | |
tree | 95255c7ae7c5075abc07995126efc76701882050 /intern/cycles/device/cuda/device_impl.cpp | |
parent | 27105af938b14c48fb498a292e2b371cbd8faf31 (diff) |
Cycles: Improve denoiser update performance when rendering with multiple GPUs
This patch causes the render buffers to be copied to the denoiser
device only once before denoising and output/display is then fed
from that single buffer on the denoiser device. That way usually all
but one copy (from all the render devices to the denoiser device)
can be eliminated, provided that the denoiser device is also the
display device (in which case interop is used to update the display).
As such this patch also adds some logic that tries to ensure the
chosen denoiser device is the same as the display device.
Differential Revision: https://developer.blender.org/D15657
Diffstat (limited to 'intern/cycles/device/cuda/device_impl.cpp')
-rw-r--r-- | intern/cycles/device/cuda/device_impl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/device/cuda/device_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp index 00851a8e91c..01c021551f3 100644 --- a/intern/cycles/device/cuda/device_impl.cpp +++ b/intern/cycles/device/cuda/device_impl.cpp @@ -1202,11 +1202,11 @@ bool CUDADevice::should_use_graphics_interop() } vector<CUdevice> gl_devices(num_all_devices); - uint num_gl_devices; + uint num_gl_devices = 0; cuGLGetDevices(&num_gl_devices, gl_devices.data(), num_all_devices, CU_GL_DEVICE_LIST_ALL); - for (CUdevice gl_device : gl_devices) { - if (gl_device == cuDevice) { + for (uint i = 0; i < num_gl_devices; ++i) { + if (gl_devices[i] == cuDevice) { return true; } } |