Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/denoiser.cpp
| Show All 13 Lines | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #include "integrator/denoiser.h" | #include "integrator/denoiser.h" | ||||
| #include "device/device.h" | #include "device/device.h" | ||||
| #include "integrator/denoiser_oidn.h" | #include "integrator/denoiser_oidn.h" | ||||
| #include "integrator/denoiser_optix.h" | #include "integrator/denoiser_optix.h" | ||||
| #include "render/buffers.h" | #include "session/buffers.h" | ||||
| #include "util/util_logging.h" | #include "util/log.h" | ||||
| #include "util/util_progress.h" | #include "util/progress.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| unique_ptr<Denoiser> Denoiser::create(Device *path_trace_device, const DenoiseParams ¶ms) | unique_ptr<Denoiser> Denoiser::create(Device *path_trace_device, const DenoiseParams ¶ms) | ||||
| { | { | ||||
| DCHECK(params.use); | DCHECK(params.use); | ||||
| switch (params.type) { | if (params.type == DENOISER_OPTIX && Device::available_devices(DEVICE_MASK_OPTIX).size()) { | ||||
| case DENOISER_OPTIX: | |||||
| return make_unique<OptiXDenoiser>(path_trace_device, params); | 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; | |||||
| } | } | ||||
| LOG(FATAL) << "Unhandled denoiser type " << params.type << ", should never happen."; | return make_unique<OIDNDenoiser>(path_trace_device, params); | ||||
| return nullptr; | |||||
| } | } | ||||
| Denoiser::Denoiser(Device *path_trace_device, const DenoiseParams ¶ms) | Denoiser::Denoiser(Device *path_trace_device, const DenoiseParams ¶ms) | ||||
| : path_trace_device_(path_trace_device), params_(params) | : path_trace_device_(path_trace_device), params_(params) | ||||
| { | { | ||||
| DCHECK(params.use); | DCHECK(params.use); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines | |||||