| 695 | |
| 696 | |
| 697 | ParallelRenderArgsSetter::ParallelRenderArgsSetter(double time, |
| 698 | ViewIdx view, |
| 699 | bool isRenderUserInteraction, |
| 700 | bool isSequential, |
| 701 | const AbortableRenderInfoPtr& abortInfo, |
| 702 | const NodePtr& treeRoot, |
| 703 | int textureIndex, |
| 704 | const TimeLine* timeline, |
| 705 | const NodePtr& activeRotoPaintNode, |
| 706 | bool isAnalysis, |
| 707 | bool draftMode, |
| 708 | const RenderStatsPtr& stats) |
| 709 | : argsMap() |
| 710 | { |
| 711 | assert(treeRoot); |
| 712 | |
| 713 | // Ensure this thread gets an OpenGL context for the render of the frame |
| 714 | OSGLContextPtr glContext; |
| 715 | try { |
| 716 | glContext = appPTR->getGPUContextPool()->attachGLContextToRender(); |
| 717 | } catch (const std::exception& /*e*/) { |
| 718 | |
| 719 | } |
| 720 | |
| 721 | _openGLContext = glContext; |
| 722 | |
| 723 | |
| 724 | bool doNanHandling = appPTR->getCurrentSettings()->isNaNHandlingEnabled(); |
| 725 | |
| 726 | FindDependenciesMap dependenciesMap; |
| 727 | getAllUpstreamNodesRecursiveWithDependencies_internal(treeRoot, dependenciesMap); |
| 728 | |
| 729 | |
| 730 | for (FindDependenciesMap::iterator it = dependenciesMap.begin(); it != dependenciesMap.end(); ++it) { |
| 731 | |
| 732 | const NodePtr& node = it->first; |
| 733 | nodes.push_back(node); |
| 734 | |
| 735 | EffectInstancePtr liveInstance = node->getEffectInstance(); |
| 736 | assert(liveInstance); |
| 737 | bool duringPaintStrokeCreation = activeRotoPaintNode && node->isDuringPaintStrokeCreation(); |
| 738 | RenderSafetyEnum safety = node->getCurrentRenderThreadSafety(); |
| 739 | PluginOpenGLRenderSupport glSupport = node->getCurrentOpenGLRenderSupport(); |
| 740 | NodesList rotoPaintNodes; |
| 741 | RotoContextPtr roto = node->getRotoContext(); |
| 742 | if (roto) { |
| 743 | roto->getRotoPaintTreeNodes(&rotoPaintNodes); |
| 744 | } |
| 745 | |
| 746 | { |
| 747 | U64 nodeHash = node->getHashValue(); |
| 748 | liveInstance->setParallelRenderArgsTLS(time, view, isRenderUserInteraction, isSequential, nodeHash, |
| 749 | abortInfo, treeRoot, it->second.visitCounter, NodeFrameRequestPtr(), glContext, textureIndex, timeline, isAnalysis, duringPaintStrokeCreation, rotoPaintNodes, safety, glSupport, doNanHandling, draftMode, stats); |
| 750 | } |
| 751 | for (NodesList::iterator it2 = rotoPaintNodes.begin(); it2 != rotoPaintNodes.end(); ++it2) { |
| 752 | U64 nodeHash = (*it2)->getHashValue(); |
| 753 | |
| 754 | // For rotopaint nodes, since the tree internally is always the same for all renders (it doesn't depend where the viewer is connected) the visits count is the number of output nodes |
nothing calls this directly
no test coverage detected