[Bf-blender-cvs] [f444d6aece4] temp-compositor-single-threaded-operation: Cleanup: Don't use mutex. Isn't needed anymore.

Jeroen Bakker noreply at git.blender.org
Fri Apr 2 14:58:29 CEST 2021


Commit: f444d6aece40528e90c6285a0c5bb59d15e6b95a
Author: Jeroen Bakker
Date:   Fri Apr 2 14:58:13 2021 +0200
Branches: temp-compositor-single-threaded-operation
https://developer.blender.org/rBf444d6aece40528e90c6285a0c5bb59d15e6b95a

Cleanup: Don't use mutex. Isn't needed anymore.

===================================================================

M	source/blender/compositor/intern/COM_SingleThreadedOperation.cc
M	source/blender/compositor/intern/COM_SingleThreadedOperation.h
M	source/blender/compositor/operations/COM_DenoiseOperation.cc
M	source/blender/compositor/operations/COM_GlareBaseOperation.cc

===================================================================

diff --git a/source/blender/compositor/intern/COM_SingleThreadedOperation.cc b/source/blender/compositor/intern/COM_SingleThreadedOperation.cc
index 7bce07f87cb..c9bef2371cd 100644
--- a/source/blender/compositor/intern/COM_SingleThreadedOperation.cc
+++ b/source/blender/compositor/intern/COM_SingleThreadedOperation.cc
@@ -28,33 +28,10 @@ SingleThreadedOperation::SingleThreadedOperation(DataType data_type)
   flags.single_threaded = true;
 }
 
-void SingleThreadedOperation::initExecution()
-{
-  WriteBufferOperation::initExecution();
-  initMutex();
-}
-
-void SingleThreadedOperation::deinitExecution()
-{
-  WriteBufferOperation::deinitExecution();
-  deinitMutex();
-}
-
 void SingleThreadedOperation::executeRegion(rcti *rect, unsigned int UNUSED(tile_number))
 {
-  if (executed) {
-    return;
-  }
-  lockMutex();
-  if (executed) {
-    return;
-  }
-
   MemoryBuffer *memory_buffer = getMemoryProxy()->getBuffer();
   update_memory_buffer(*memory_buffer, rect);
-
-  unlockMutex();
-  executed = true;
 }
 
 }  // namespace blender::compositor
diff --git a/source/blender/compositor/intern/COM_SingleThreadedOperation.h b/source/blender/compositor/intern/COM_SingleThreadedOperation.h
index 7cca768c55e..3a826a15371 100644
--- a/source/blender/compositor/intern/COM_SingleThreadedOperation.h
+++ b/source/blender/compositor/intern/COM_SingleThreadedOperation.h
@@ -23,28 +23,9 @@
 namespace blender::compositor {
 
 class SingleThreadedOperation : public WriteBufferOperation {
- private:
-  bool executed = false;
-
- protected:
-  bool is_executed()
-  {
-    return executed;
-  }
-
  public:
   SingleThreadedOperation(DataType data_type);
 
-  /**
-   * Initialize the execution
-   */
-  void initExecution() override;
-
-  /**
-   * Deinitialize the execution
-   */
-  void deinitExecution() override;
-
   void executeRegion(rcti *rect, unsigned int tile_number) override;
 
   virtual void update_memory_buffer(MemoryBuffer &memory_buffer, rcti *rect) = 0;
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cc b/source/blender/compositor/operations/COM_DenoiseOperation.cc
index 12a03377919..8005d84630f 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.cc
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.cc
@@ -64,10 +64,6 @@ bool DenoiseOperation::determineDependingAreaOfInterest(rcti * /*input*/,
                                                         ReadBufferOperation *readOperation,
                                                         rcti *output)
 {
-  if (is_executed()) {
-    return false;
-  }
-
   rcti newInput;
   newInput.xmax = this->getWidth();
   newInput.xmin = 0;
diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.cc b/source/blender/compositor/operations/COM_GlareBaseOperation.cc
index 7b27c38159a..ba03c9fb2e2 100644
--- a/source/blender/compositor/operations/COM_GlareBaseOperation.cc
+++ b/source/blender/compositor/operations/COM_GlareBaseOperation.cc
@@ -48,10 +48,6 @@ bool GlareBaseOperation::determineDependingAreaOfInterest(rcti * /*input*/,
                                                           ReadBufferOperation *readOperation,
                                                           rcti *output)
 {
-  if (is_executed()) {
-    return false;
-  }
-
   rcti newInput;
   newInput.xmax = this->getWidth();
   newInput.xmin = 0;



More information about the Bf-blender-cvs mailing list