[Bf-blender-cvs] [5780de2ae05] master: Compositor: Enable constant folding on operations

Manuel Castilla noreply at git.blender.org
Tue Jul 6 18:16:41 CEST 2021


Commit: 5780de2ae052e76747ee50778c58264c74a6f9e8
Author: Manuel Castilla
Date:   Tue Jul 6 16:16:49 2021 +0200
Branches: master
https://developer.blender.org/rB5780de2ae052e76747ee50778c58264c74a6f9e8

Compositor: Enable constant folding on operations

Only on current full frame operations that can be constant.

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

M	source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
M	source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
M	source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
M	source/blender/compositor/operations/COM_ColorExposureOperation.cc
M	source/blender/compositor/operations/COM_GammaOperation.cc
M	source/blender/compositor/operations/COM_IDMaskOperation.cc

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

diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
index b6f20a740f5..aee8c0d52e8 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
@@ -41,6 +41,7 @@ ColorBalanceASCCDLOperation::ColorBalanceASCCDLOperation()
   this->m_inputValueOperation = nullptr;
   this->m_inputColorOperation = nullptr;
   this->setResolutionInputSocketIndex(1);
+  flags.can_be_constant = true;
 }
 
 void ColorBalanceASCCDLOperation::initExecution()
diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
index 36307f0b136..674cb79a238 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cc
@@ -46,6 +46,7 @@ ColorBalanceLGGOperation::ColorBalanceLGGOperation()
   this->m_inputValueOperation = nullptr;
   this->m_inputColorOperation = nullptr;
   this->setResolutionInputSocketIndex(1);
+  flags.can_be_constant = true;
 }
 
 void ColorBalanceLGGOperation::initExecution()
diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
index fa5c8c994d4..b50145b106d 100644
--- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cc
@@ -33,6 +33,7 @@ ColorCorrectionOperation::ColorCorrectionOperation()
   this->m_redChannelEnabled = true;
   this->m_greenChannelEnabled = true;
   this->m_blueChannelEnabled = true;
+  flags.can_be_constant = true;
 }
 void ColorCorrectionOperation::initExecution()
 {
diff --git a/source/blender/compositor/operations/COM_ColorExposureOperation.cc b/source/blender/compositor/operations/COM_ColorExposureOperation.cc
index 9e527f269cf..228550a31c5 100644
--- a/source/blender/compositor/operations/COM_ColorExposureOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorExposureOperation.cc
@@ -26,6 +26,7 @@ ExposureOperation::ExposureOperation()
   this->addInputSocket(DataType::Value);
   this->addOutputSocket(DataType::Color);
   this->m_inputProgram = nullptr;
+  flags.can_be_constant = true;
 }
 
 void ExposureOperation::initExecution()
diff --git a/source/blender/compositor/operations/COM_GammaOperation.cc b/source/blender/compositor/operations/COM_GammaOperation.cc
index 7083c677f03..396d3942b06 100644
--- a/source/blender/compositor/operations/COM_GammaOperation.cc
+++ b/source/blender/compositor/operations/COM_GammaOperation.cc
@@ -28,6 +28,7 @@ GammaOperation::GammaOperation()
   this->addOutputSocket(DataType::Color);
   this->m_inputProgram = nullptr;
   this->m_inputGammaProgram = nullptr;
+  flags.can_be_constant = true;
 }
 void GammaOperation::initExecution()
 {
diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.cc b/source/blender/compositor/operations/COM_IDMaskOperation.cc
index 38f8b7e075f..bb11ac8b1be 100644
--- a/source/blender/compositor/operations/COM_IDMaskOperation.cc
+++ b/source/blender/compositor/operations/COM_IDMaskOperation.cc
@@ -25,6 +25,7 @@ IDMaskOperation::IDMaskOperation()
   this->addInputSocket(DataType::Value);
   this->addOutputSocket(DataType::Value);
   this->flags.complex = true;
+  flags.can_be_constant = true;
 }
 
 void *IDMaskOperation::initializeTileData(rcti *rect)



More information about the Bf-blender-cvs mailing list