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

Method compile

Source/Falcor/RenderGraph/RenderGraphCompiler.cpp:49–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47{}
48
49std::unique_ptr<RenderGraphExe> RenderGraphCompiler::compile(
50 RenderGraph& graph,
51 RenderContext* pRenderContext,
52 const Dependencies& dependencies
53)
54{
55 RenderGraphCompiler c = RenderGraphCompiler(graph, dependencies);
56
57 // Register the external resources
58 auto pResourcesCache = std::make_unique<ResourceCache>();
59 for (const auto& [name, pRes] : dependencies.externalResources)
60 pResourcesCache->registerExternalResource(name, pRes);
61
62 c.resolveExecutionOrder();
63 c.compilePasses(pRenderContext);
64 if (c.insertAutoPasses())
65 c.resolveExecutionOrder();
66 c.validateGraph();
67 c.allocateResources(pRenderContext->getDevice(), pResourcesCache.get());
68
69 auto pExe = std::make_unique<RenderGraphExe>();
70 pExe->mExecutionList.reserve(c.mExecutionList.size());
71
72 for (auto e : c.mExecutionList)
73 {
74 pExe->insertPass(e.name, e.pPass);
75 }
76 c.restoreCompilationChanges();
77 pExe->mpResourceCache = std::move(pResourcesCache);
78 return pExe;
79}
80
81void RenderGraphCompiler::validateGraph() const
82{

Callers 1

compilePassesMethod · 0.45

Calls 13

RenderGraphCompilerClass · 0.85
resolveExecutionOrderMethod · 0.80
compilePassesMethod · 0.80
insertAutoPassesMethod · 0.80
validateGraphMethod · 0.80
insertPassMethod · 0.80
allocateResourcesMethod · 0.45
getDeviceMethod · 0.45
getMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected