Skip to content

Commit

Permalink
Potential fix to support denoising on differently mixed devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
boberfly committed Oct 5, 2020
1 parent a1f2ce6 commit b3d56e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/GafferCycles/IECoreCyclesPreview/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion src/GafferCyclesModule/GafferCyclesModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b3d56e2

Please sign in to comment.