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

Method import

Source/Falcor/RenderGraph/RenderGraphImportExport.cpp:67–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67ref<RenderGraph> RenderGraphImporter::import(std::string graphName, std::filesystem::path path, std::string funcName)
68{
69 while (true)
70 {
71 try
72 {
73 updateGraphStrings(graphName, path, funcName);
74 std::string custom;
75 if (funcName.size())
76 custom += "\n" + graphName + '=' + funcName + "()";
77 // TODO: Rendergraph scripts should be executed in an isolated scripting context.
78 runScriptFile(path, custom);
79
80 auto pGraph = Scripting::getDefaultContext().getObject<ref<RenderGraph>>(graphName);
81 if (!pGraph)
82 throw("Unspecified error");
83
84 pGraph->setName(graphName);
85 return pGraph;
86 }
87 catch (const std::exception& e)
88 {
89 if (loadFailed(e, path))
90 return nullptr;
91 }
92 }
93}
94
95std::vector<ref<RenderGraph>> RenderGraphImporter::importAllGraphs(const std::filesystem::path& path)
96{

Callers

nothing calls this directly

Calls 5

updateGraphStringsFunction · 0.85
runScriptFileFunction · 0.85
loadFailedFunction · 0.85
sizeMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected