Commit: 0ab1b19de4da2db53548d82d66c8ea5ed40e0f6c
Author: Brecht Van Lommel
Date:   Sun Oct 31 22:11:36 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB0ab1b19de4da2db53548d82d66c8ea5ed40e0f6c

Fix T92684: Cycles does not fall back to OIDN if OptiX is not available

===================================================================

M       intern/cycles/integrator/denoiser.cpp

===================================================================

diff --git a/intern/cycles/integrator/denoiser.cpp 
b/intern/cycles/integrator/denoiser.cpp
index b6ca96faebf..b89024e0c85 100644
--- a/intern/cycles/integrator/denoiser.cpp
+++ b/intern/cycles/integrator/denoiser.cpp
@@ -29,23 +29,11 @@ unique_ptr<Denoiser> Denoiser::create(Device 
*path_trace_device, const DenoisePa
 {
   DCHECK(params.use);
 
-  switch (params.type) {
-    case DENOISER_OPTIX:
-      return make_unique<OptiXDenoiser>(path_trace_device, params);
-
-    case DENOISER_OPENIMAGEDENOISE:
-      return make_unique<OIDNDenoiser>(path_trace_device, params);
-
-    case DENOISER_NUM:
-    case DENOISER_NONE:
-    case DENOISER_ALL:
-      /* pass */
-      break;
+  if (params.type == DENOISER_OPTIX && 
Device::available_devices(DEVICE_MASK_OPTIX).size()) {
+    return make_unique<OptiXDenoiser>(path_trace_device, params);
   }
 
-  LOG(FATAL) << "Unhandled denoiser type " << params.type << ", should never 
happen.";
-
-  return nullptr;
+  return make_unique<OIDNDenoiser>(path_trace_device, params);
 }
 
 Denoiser::Denoiser(Device *path_trace_device, const DenoiseParams &params)

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to