| 844 | } |
| 845 | |
| 846 | ParallelRenderArgsSetter::~ParallelRenderArgsSetter() |
| 847 | { |
| 848 | for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) { |
| 849 | if ( !(*it) || !(*it)->getEffectInstance() ) { |
| 850 | continue; |
| 851 | } |
| 852 | (*it)->getEffectInstance()->invalidateParallelRenderArgsTLS(); |
| 853 | |
| 854 | if ( (*it)->isMultiInstance() ) { |
| 855 | ///If the node has children, set the thread-local storage on them too, even if they do not render, it can be useful for expressions |
| 856 | ///on parameters. |
| 857 | NodesList children; |
| 858 | (*it)->getChildrenMultiInstance(&children); |
| 859 | for (NodesList::iterator it2 = children.begin(); it2 != children.end(); ++it2) { |
| 860 | (*it2)->getEffectInstance()->invalidateParallelRenderArgsTLS(); |
| 861 | } |
| 862 | } |
| 863 | |
| 864 | /* NodeGroup* isGrp = (*it)->isEffectGroup(); |
| 865 | if (isGrp) { |
| 866 | isGrp->invalidateParallelRenderArgs(); |
| 867 | }*/ |
| 868 | } |
| 869 | |
| 870 | if (argsMap) { |
| 871 | for (std::map<NodePtr, ParallelRenderArgsPtr>::iterator it = argsMap->begin(); it != argsMap->end(); ++it) { |
| 872 | it->first->getEffectInstance()->invalidateParallelRenderArgsTLS(); |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | OSGLContextPtr glContext = _openGLContext.lock(); |
| 877 | if (glContext) { |
| 878 | // This render is going to end, release the OpenGL context so that another frame render may use it |
| 879 | appPTR->getGPUContextPool()->releaseGLContextFromRender(glContext); |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | ParallelRenderArgs::ParallelRenderArgs() |
| 884 | : time(0) |
nothing calls this directly
no test coverage detected