MCPcopy Create free account
hub / github.com/MrKepzie/Natron / ParallelRenderArgsSetter

Method ParallelRenderArgsSetter

Engine/ParallelRenderArgs.cpp:689–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Tested by

no test coverage detected