diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-07-08 14:48:41 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-07-08 14:51:35 +0400 |
commit | a5902fb276933278bd8db86a9b1938fe649662d8 (patch) | |
tree | 95d9d8999427ec2b52d59975c5ac8e171c628d8b /source/blender/compositor/intern/COM_NodeOperationBuilder.h | |
parent | bd7fbd43273b63655886b60b7bba7c36e6a9755a (diff) |
Fix T40986: crash on using the viewer node inside of group nodes.
Viewers were activated both inside the active group as well as the top
level tree (the latter being a quick fix for getting a fallback viewer).
This caused a race condition on the shared viewer image.
Now the active viewer is defined at node conversion time in the converter
so that only one can be active at a time without each node having to
follow complicated rules for exclusion.
Diffstat (limited to 'source/blender/compositor/intern/COM_NodeOperationBuilder.h')
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperationBuilder.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.h b/source/blender/compositor/intern/COM_NodeOperationBuilder.h index ab890282bab..633ddc9152a 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.h +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.h @@ -44,6 +44,7 @@ class NodeOperationOutput; class PreviewOperation; class WriteBufferOperation; +class ViewerOperation; class NodeOperationBuilder { public: @@ -87,6 +88,12 @@ private: Node *m_current_node; + /** Operation that will be writing to the viewer image + * Only one operation can occupy this place at a time, + * to avoid race conditions + */ + ViewerOperation *m_active_viewer; + public: NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree); ~NodeOperationBuilder(); @@ -110,6 +117,11 @@ public: /** Add a preview operation for a node input */ void addNodeInputPreview(NodeInput *input); + /** Define a viewer operation as the active output, if possible */ + void registerViewer(ViewerOperation *viewer); + /** The currently active viewer output operation */ + ViewerOperation *active_viewer() const { return m_active_viewer; } + protected: static NodeInput *find_node_input(const InputSocketMap &map, NodeOperationInput *op_input); static const OpInputs &find_operation_inputs(const OpInputInverseMap &map, NodeInput *node_input); |