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

This commit is contained in:
Brecht Van Lommel 2021-10-31 22:11:36 +01:00
parent cedc80c08d
commit 0ab1b19de4
Notes: blender-bot 2023-02-14 06:05:22 +01:00
Referenced by issue #94127, Cycles/Compositor: The denoiser returns a black image if not all requirements are fulfilled
Referenced by issue #92684, Cycles Render with light
1 changed files with 3 additions and 15 deletions

View File

@ -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)