diff options
author | Patrick Mours <pmours@nvidia.com> | 2020-02-24 19:53:41 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2020-02-24 19:53:41 +0300 |
commit | f7b6b7dda358c7928ca053c27357bc068b8c9d12 (patch) | |
tree | 5b9421ef05cd12afbdec9167983be1de25b65265 /intern/cycles/blender/blender_device.cpp | |
parent | 14856e149ff5c225ffe5a4022794cd12f7632f71 (diff) |
Fix unnecessary Cycles OptiX kernel loading
With the OptiX viewport denoiser active, an OptiX device was added to the device list even when
rendering and denoising on different devices (e.g. CPU or CUDA) in background rendering. This
fixes it, so the OptiX device is only added when actually needed, as in only when OptiX denoising is
actually active in background rendering.
Diffstat (limited to 'intern/cycles/blender/blender_device.cpp')
-rw-r--r-- | intern/cycles/blender/blender_device.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_device.cpp b/intern/cycles/blender/blender_device.cpp index c3c307318a8..d0f8465a98f 100644 --- a/intern/cycles/blender/blender_device.cpp +++ b/intern/cycles/blender/blender_device.cpp @@ -115,8 +115,9 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scen } /* Ensure there is an OptiX device when using the OptiX denoiser. */ - bool use_optix_denoising = DENOISER_OPTIX == - get_enum(cscene, "preview_denoising", DENOISER_NUM, DENOISER_NONE); + bool use_optix_denoising = get_enum(cscene, "preview_denoising", DENOISER_NUM, DENOISER_NONE) == + DENOISER_OPTIX && + !background; BL::Scene::view_layers_iterator b_view_layer; for (b_scene.view_layers.begin(b_view_layer); b_view_layer != b_scene.view_layers.end(); ++b_view_layer) { |