Cleanup: Removed redundant code in OIDN integration

There was an unused mutex, memory limits can be left at their defaults.
This commit is contained in:
Werner, Stefan
2023-12-07 14:08:59 +01:00
parent 1592aaf01a
commit 3e7b8381cc
2 changed files with 3 additions and 19 deletions

View File

@@ -27,13 +27,10 @@
CCL_NAMESPACE_BEGIN
/* Ideally, this would be dynamic and adaptively change when the runtime runs out of memory. */
constexpr int prefilter_max_mem = 1024;
thread_mutex OIDNDenoiserGPU::mutex_;
bool OIDNDenoiserGPU::is_device_type_supported(const DeviceType &type)
bool OIDNDenoiserGPU::is_device_supported(const DeviceInfo &device)
{
switch (type) {
/* Currently falls back to checking just the device type, can be improved. */
switch (device.type) {
# ifdef OIDN_DEVICE_SYCL
/* Assume all devices with Cycles support are also supported by OIDN2. */
case DEVICE_ONEAPI:
@@ -44,12 +41,6 @@ bool OIDNDenoiserGPU::is_device_type_supported(const DeviceType &type)
}
}
bool OIDNDenoiserGPU::is_device_supported(const DeviceInfo &device)
{
/* Currently falls back to checking just the device type, can be improved. */
return is_device_type_supported(device.type);
}
OIDNDenoiserGPU::OIDNDenoiserGPU(Device *path_trace_device, const DenoiseParams &params)
: DenoiserGPU(path_trace_device, params)
{
@@ -156,7 +147,6 @@ bool OIDNDenoiserGPU::denoise_create_if_needed(DenoiseContext &context)
if (context.use_pass_albedo) {
albedo_filter_ = create_filter();
if (albedo_filter_ == nullptr) {
oidnSetFilterInt(oidn_filter_, "maxMemoryMB", prefilter_max_mem);
return false;
}
}
@@ -164,7 +154,6 @@ bool OIDNDenoiserGPU::denoise_create_if_needed(DenoiseContext &context)
if (context.use_pass_normal) {
normal_filter_ = create_filter();
if (normal_filter_ == nullptr) {
oidnSetFilterInt(oidn_filter_, "maxMemoryMB", prefilter_max_mem);
return false;
}
}

View File

@@ -34,15 +34,10 @@ class OIDNDenoiserGPU : public DenoiserGPU {
bool allow_inplace_modification) override;
static bool is_device_supported(const DeviceInfo &device);
static bool is_device_type_supported(const DeviceType &type);
protected:
virtual uint get_device_type_mask() const override;
/* We only perform one denoising at a time, since OpenImageDenoise itself is multithreaded.
* Use this mutex whenever images are passed to the OIDN and needs to be denoised. */
static thread_mutex mutex_;
/* Create OIDN denoiser descriptor if needed.
* Will do nothing if the current OIDN descriptor is usable for the given parameters.
* If the OIDN denoiser descriptor did re-allocate here it is left unconfigured. */