[Bf-blender-cvs] [f1ce835418f] temp-fix-tests-arm64: Revert "Fix (unreported): TextureOperation inputs have no resolution"

Manuel Castilla noreply at git.blender.org
Tue Jun 8 22:34:59 CEST 2021


Commit: f1ce835418f16fde63c636ebf5257bdfe3ee48c3
Author: Manuel Castilla
Date:   Tue Jun 8 21:56:55 2021 +0200
Branches: temp-fix-tests-arm64
https://developer.blender.org/rBf1ce835418f16fde63c636ebf5257bdfe3ee48c3

Revert "Fix (unreported): TextureOperation inputs have no resolution"

This reverts commit e9f2f17e8518f31706756b4ebe7c38a3582a3612.

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

M	source/blender/compositor/operations/COM_TextureOperation.cc
M	source/blender/compositor/operations/COM_TextureOperation.h

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

diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc
index 7517ff8a137..e94c457f981 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cc
+++ b/source/blender/compositor/operations/COM_TextureOperation.cc
@@ -75,13 +75,16 @@ 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];
+  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];
+  }
 }
 
 void TextureAlphaOperation::executePixelSampled(float output[4],
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index e5f56673694..e1e04611c6c 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -44,7 +44,7 @@ class TextureBaseOperation : public NodeOperation {
 
  protected:
   /**
-   * Determine the output resolution.
+   * Determine the output resolution. The resolution is retrieved from the Renderer
    */
   void determineResolution(unsigned int resolution[2],
                            unsigned int preferredResolution[2]) override;



More information about the Bf-blender-cvs mailing list