Skip to content

Commit b3d56e2

Browse files
committed
Potential fix to support denoising on differently mixed devices.
1 parent a1f2ce6 commit b3d56e2

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/GafferCycles/IECoreCyclesPreview/Renderer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,6 +4165,20 @@ class CyclesRenderer final : public IECoreScenePreview::Renderer
41654165
m_sessionParams.device = device_fallback;
41664166
}
41674167

4168+
if( m_sessionParams.denoising.use )
4169+
{
4170+
/* Add additional denoising devices if we are rendering and denoising
4171+
* with different devices. */
4172+
m_sessionParams.device.add_denoising_devices( m_sessionParams.denoising.type );
4173+
4174+
/* Check if denoiser is supported by device. */
4175+
if( !( m_sessionParams.device.denoisers & m_sessionParams.denoising.type ) )
4176+
{
4177+
IECore::msg( IECore::Msg::Warning, "CyclesRenderer", "Chosen denoising is not compatible with device." );
4178+
m_sessionParams.denoising.use = false;
4179+
}
4180+
}
4181+
41684182
if( m_session )
41694183
{
41704184
// A trick to retain the same pointer when re-creating a session.

src/GafferCyclesModule/GafferCyclesModule.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ static py::list getDevices()
8282
d["id"] = device.id;
8383
d["num"] = device.num;
8484
d["display_device"] = device.display_device;
85-
//d["advanced_shading"] = device.advanced_shading;
8685
d["has_half_images"] = device.has_half_images;
8786
d["has_volume_decoupled"] = device.has_volume_decoupled;
87+
d["has_adaptive_stop_per_sample"] = device.has_adaptive_stop_per_sample;
8888
d["has_osl"] = device.has_osl;
8989
d["use_split_kernel"] = device.use_split_kernel;
9090
d["has_profiling"] = device.has_profiling;
9191
d["cpu_threads"] = device.cpu_threads;
92+
d["has_peer_memory"] = device.has_peer_memory;
93+
d["denoisers"] = device.denoisers;
9294

9395
if( device.type == ccl::DEVICE_OPTIX )
9496
py::scope().attr( "hasOptixDenoise" ) = true;

0 commit comments

Comments
 (0)