diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-06-09 12:10:21 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-06-09 12:21:23 +0300 |
commit | b18a214ecba602f8d06ec40ee03111308c9afbd7 (patch) | |
tree | 8a57a6f11af34a3206128bfeb368b5d98085e9b2 /source | |
parent | d7c812f15befb161d47451afdeba9d070a7d81a7 (diff) |
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
Diffstat (limited to 'source')
3 files changed, 37 insertions, 7 deletions
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 @@ -297,6 +297,11 @@ class NodeOperation { protected: /** + * Compositor execution model. + */ + eExecutionModel execution_model_; + + /** * Width of the output of this operation. */ unsigned int m_width; @@ -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], |