diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 18:54:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 18:56:04 +0300 |
commit | 1e6e3dcbd7cd4bc0148062e15229cd284cb30f7d (patch) | |
tree | e46954d8555f007abe900d1a6a8daeaff1231899 /source/blender/compositor | |
parent | 20c5c5e14ba0820b106945331f07909a756ff2d3 (diff) |
Fix T45529: Texture Compositor node composition artifact (random pixels)
The issue was caused by the non-threaded texture API used by the node.
While the node itself is single threaded there might be texture nodes
in different execution groups running in parallel.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/operations/COM_TextureOperation.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 2ff6cc047c6..c75c4040823 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -23,8 +23,11 @@ #include "COM_TextureOperation.h" #include "BLI_listbase.h" +#include "BLI_threads.h" #include "BKE_image.h" +static ThreadMutex mutex_lock = BLI_MUTEX_INITIALIZER; + TextureBaseOperation::TextureBaseOperation() : SingleThreadedOperation() { this->addInputSocket(COM_DT_VECTOR); //offset @@ -100,7 +103,12 @@ void TextureBaseOperation::executePixelSampled(float output[4], float x, float y vec[1] = textureSize[1] * (v + textureOffset[1]); vec[2] = textureSize[2] * textureOffset[2]; + /* TODO(sergey): Need to pass thread ID to the multitex code, + * then we can avoid having mutex here. + */ + BLI_mutex_lock(&mutex_lock); retval = multitex_ext(this->m_texture, vec, NULL, NULL, 0, &texres, m_pool, m_sceneColorManage, false); + BLI_mutex_unlock(&mutex_lock); if (texres.talpha) output[3] = texres.ta; |