From 0ab1b19de4da2db53548d82d66c8ea5ed40e0f6c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 31 Oct 2021 22:11:36 +0100 Subject: Fix T92684: Cycles does not fall back to OIDN if OptiX is not available --- intern/cycles/integrator/denoiser.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'intern/cycles/integrator') 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::create(Device *path_trace_device, const DenoisePa { DCHECK(params.use); - switch (params.type) { - case DENOISER_OPTIX: - return make_unique(path_trace_device, params); - - case DENOISER_OPENIMAGEDENOISE: - return make_unique(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(path_trace_device, params); } - LOG(FATAL) << "Unhandled denoiser type " << params.type << ", should never happen."; - - return nullptr; + return make_unique(path_trace_device, params); } Denoiser::Denoiser(Device *path_trace_device, const DenoiseParams ¶ms) -- cgit v1.2.3