MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / update

Method update

Source/Falcor/RenderGraph/RenderGraph.cpp:455–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void RenderGraph::update(const ref<RenderGraph>& pGraph)
456{
457 // Fill in missing passes from referenced graph.
458 for (const auto& nameIndexPair : pGraph->mNameToIndex)
459 {
460 ref<RenderPass> pRenderPass = pGraph->mNodeData[nameIndexPair.second].pPass;
461 if (!doesPassExist(nameIndexPair.first))
462 addPass(pRenderPass, nameIndexPair.first);
463 }
464
465 // Remove nodes that should no longer be within the graph.
466 std::vector<std::string> passesToRemove;
467
468 for (const auto& nameIndexPair : mNameToIndex)
469 {
470 if (!pGraph->doesPassExist(nameIndexPair.first))
471 {
472 passesToRemove.push_back(nameIndexPair.first);
473 }
474 }
475
476 for (const std::string& passName : passesToRemove)
477 {
478 removePass(passName);
479 }
480
481 // Remove all edges from this graph.
482 for (uint32_t i = 0; i < mpGraph->getCurrentEdgeId(); ++i)
483 {
484 if (!mpGraph->doesEdgeExist(i))
485 {
486 continue;
487 }
488
489 mpGraph->removeEdge(i);
490 }
491 mEdgeData.clear();
492
493 // Add all edges from the other graph.
494 for (uint32_t i = 0; i < pGraph->mpGraph->getCurrentEdgeId(); ++i)
495 {
496 if (!pGraph->mpGraph->doesEdgeExist(i))
497 {
498 continue;
499 }
500
501 const DirectedGraph::Edge* pEdge = pGraph->mpGraph->getEdge(i);
502 std::string dst = pGraph->mNodeData.find(pEdge->getDestNode())->second.name;
503 std::string src = pGraph->mNodeData.find(pEdge->getSourceNode())->second.name;
504
505 if ((mNameToIndex.find(src) != mNameToIndex.end()) && (mNameToIndex.find(dst) != mNameToIndex.end()))
506 {
507 if (pGraph->mEdgeData[i].dstField.size())
508 dst += std::string(".") + pGraph->mEdgeData[i].dstField;
509 if (pGraph->mEdgeData[i].srcField.size())
510 src += std::string(".") + pGraph->mEdgeData[i].srcField;
511 addEdge(src, dst);
512 }

Callers

nothing calls this directly

Calls 14

doesPassExistFunction · 0.85
stringFunction · 0.85
getCurrentEdgeIdMethod · 0.80
doesEdgeExistMethod · 0.80
getDestNodeMethod · 0.80
getSourceNodeMethod · 0.80
getOutputMasksMethod · 0.80
push_backMethod · 0.45
removeEdgeMethod · 0.45
clearMethod · 0.45
getEdgeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected