From b3d56e229ffcb35a1259e0c3b8d5528dbf4ccb75 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Oct 2020 00:48:51 -0700 Subject: [PATCH] Potential fix to support denoising on differently mixed devices. --- src/GafferCycles/IECoreCyclesPreview/Renderer.cpp | 14 ++++++++++++++ src/GafferCyclesModule/GafferCyclesModule.cpp | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp b/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp index 272c085..badf9e0 100644 --- a/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp +++ b/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp @@ -4165,6 +4165,20 @@ class CyclesRenderer final : public IECoreScenePreview::Renderer m_sessionParams.device = device_fallback; } + if( m_sessionParams.denoising.use ) + { + /* Add additional denoising devices if we are rendering and denoising + * with different devices. */ + m_sessionParams.device.add_denoising_devices( m_sessionParams.denoising.type ); + + /* Check if denoiser is supported by device. */ + if( !( m_sessionParams.device.denoisers & m_sessionParams.denoising.type ) ) + { + IECore::msg( IECore::Msg::Warning, "CyclesRenderer", "Chosen denoising is not compatible with device." ); + m_sessionParams.denoising.use = false; + } + } + if( m_session ) { // A trick to retain the same pointer when re-creating a session. diff --git a/src/GafferCyclesModule/GafferCyclesModule.cpp b/src/GafferCyclesModule/GafferCyclesModule.cpp index 1a3a958..e32d704 100644 --- a/src/GafferCyclesModule/GafferCyclesModule.cpp +++ b/src/GafferCyclesModule/GafferCyclesModule.cpp @@ -82,13 +82,15 @@ static py::list getDevices() d["id"] = device.id; d["num"] = device.num; d["display_device"] = device.display_device; - //d["advanced_shading"] = device.advanced_shading; d["has_half_images"] = device.has_half_images; d["has_volume_decoupled"] = device.has_volume_decoupled; + d["has_adaptive_stop_per_sample"] = device.has_adaptive_stop_per_sample; d["has_osl"] = device.has_osl; d["use_split_kernel"] = device.use_split_kernel; d["has_profiling"] = device.has_profiling; d["cpu_threads"] = device.cpu_threads; + d["has_peer_memory"] = device.has_peer_memory; + d["denoisers"] = device.denoisers; if( device.type == ccl::DEVICE_OPTIX ) py::scope().attr( "hasOptixDenoise" ) = true;