[Bf-blender-cvs] [b18a214ecba] master: Fix: Compositor test desintegrate failing on arm64

Manuel Castilla noreply at git.blender.org
Wed Jun 9 11:30:22 CEST 2021


Commit: b18a214ecba602f8d06ec40ee03111308c9afbd7
Author: Manuel Castilla
Date:   Wed Jun 9 11:10:21 2021 +0200
Branches: master
https://developer.blender.org/rBb18a214ecba602f8d06ec40ee03111308c9afbd7

Fix: Compositor test desintegrate failing on arm64

Changes introduced in commit rBe9f2f17e8518
can create different render results when there is
a Math or Mix operation after TextureOperation
on tiled execution model.
This is due to WriteBufferOperation forcing a single pixel
resolution when these operations use a preferred
resolution of 0 to check if their inputs have resolution.
Fixing this behaviour creates different renders too.

This patch keeps previous tiled implementation and
adds the new implementation only for full frame execution.

Reviewed By: Jeroen Bakker (jbakker)

Differential Revision: https://developer.blender.org/D11546

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

M	source/blender/compositor/intern/COM_NodeOperation.h
M	source/blender/compositor/intern/COM_NodeOperationBuilder.cc
M	source/blender/compositor/operations/COM_TextureOperation.cc

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

diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h
index 11b293a400f..5c4d6dd19ba 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.h
+++ b/source/blender/compositor/intern/COM_NodeOperation.h
@@ -296,6 +296,11 @@ class NodeOperation {
   const bNodeTree *m_btree;
 
  protected:
+  /**
+   * Compositor execution model.
+   */
+  eExecutionModel execution_model_;
+
   /**
    * Width of the output of this operation.
    */
@@ -316,6 +321,11 @@ class NodeOperation {
   {
   }
 
+  void set_execution_model(const eExecutionModel model)
+  {
+    execution_model_ = model;
+  }
+
   void set_name(const std::string name)
   {
     m_name = name;
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
index c81a5a2bd98..1beb83bb477 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
@@ -129,6 +129,7 @@ void NodeOperationBuilder::addOperation(NodeOperation *operation)
   if (m_current_node) {
     operation->set_name(m_current_node->getbNode()->name);
   }
+  operation->set_execution_model(m_context->get_execution_model());
 }
 
 void NodeOperationBuilder::mapInputSocket(NodeInput *node_socket,
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc
index 7517ff8a137..059a289ae4d 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cc
+++ b/source/blender/compositor/operations/COM_TextureOperation.cc
@@ -75,13 +75,32 @@ void TextureBaseOperation::deinitExecution()
 void TextureBaseOperation::determineResolution(unsigned int resolution[2],
                                                unsigned int preferredResolution[2])
 {
-  /* Determine inputs resolutions. */
-  unsigned int temp[2];
-  NodeOperation::determineResolution(temp, preferredResolution);
-
-  /* We don't use inputs resolutions because they are only used as parameters, not image data. */
-  resolution[0] = preferredResolution[0];
-  resolution[1] = preferredResolution[1];
+  switch (execution_model_) {
+    case eExecutionModel::Tiled: {
+      if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
+        int width = this->m_rd->xsch * this->m_rd->size / 100;
+        int height = this->m_rd->ysch * this->m_rd->size / 100;
+        resolution[0] = width;
+        resolution[1] = height;
+      }
+      else {
+        resolution[0] = preferredResolution[0];
+        resolution[1] = preferredResolution[1];
+      }
+      break;
+    }
+    case eExecutionModel::FullFrame: {
+      /* Determine inputs resolutions. */
+      unsigned int temp[2];
+      NodeOperation::determineResolution(temp, preferredResolution);
+
+      /* We don't use inputs resolutions because they are only used as parameters, not image data.
+       */
+      resolution[0] = preferredResolution[0];
+      resolution[1] = preferredResolution[1];
+      break;
+    }
+  }
 }
 
 void TextureAlphaOperation::executePixelSampled(float output[4],



More information about the Bf-blender-cvs mailing list