[Bf-blender-cvs] [7a81154d1b0] temp-gpencil-bezier-stroke-type: Compositor: Allocate OIDN memory after receiving lock.
Jeroen Bakker
noreply at git.blender.org
Tue Apr 13 11:29:18 CEST 2021
Commit: 7a81154d1b0c5c838786ad646c42c4de9a414200
Author: Jeroen Bakker
Date: Mon Apr 12 14:29:49 2021 +0200
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB7a81154d1b0c5c838786ad646c42c4de9a414200
Compositor: Allocate OIDN memory after receiving lock.
Related to {T77023}. When using many Denoise nodes the memory in OIDN
are allocated up front. A mutex could stall the process until. This
change will allocate the memory after it received the lock.
===================================================================
M source/blender/compositor/operations/COM_DenoiseOperation.cc
===================================================================
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cc b/source/blender/compositor/operations/COM_DenoiseOperation.cc
index 587afdc2d00..ec11ad4d69a 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.cc
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.cc
@@ -101,6 +101,11 @@ void DenoiseOperation::generateDenoise(float *data,
if (BLI_cpu_support_sse41())
# endif
{
+ /* Since it's memory intensive, it's better to run only one instance of OIDN at a time.
+ * OpenImageDenoise is multithreaded internally and should use all available cores nonetheless.
+ */
+ BLI_mutex_lock(&oidn_lock);
+
oidn::DeviceRef device = oidn::newDevice();
device.commit();
@@ -145,10 +150,6 @@ void DenoiseOperation::generateDenoise(float *data,
}
filter.commit();
- /* Since it's memory intensive, it's better to run only one instance of OIDN at a time.
- * OpenImageDenoise is multithreaded internally and should use all available cores nonetheless.
- */
- BLI_mutex_lock(&oidn_lock);
filter.execute();
BLI_mutex_unlock(&oidn_lock);
More information about the Bf-blender-cvs
mailing list