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

Method getIR

Source/Falcor/RenderGraph/RenderGraphImportExport.cpp:128–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128std::string RenderGraphExporter::getIR(const ref<RenderGraph>& pGraph)
129{
130 RenderGraphIR ir(pGraph->getName());
131
132 // Add the passes
133 for (const auto& node : pGraph->mNodeData)
134 {
135 const auto& nodeData = node.second;
136 ir.createPass(nodeData.pPass->getType(), nodeData.name, nodeData.pPass->getProperties());
137 }
138
139 // Add the edges
140 for (const auto& edge : pGraph->mEdgeData)
141 {
142 const auto& edgeData = edge.second;
143 const auto& srcPass = pGraph->mNodeData[pGraph->mpGraph->getEdge(edge.first)->getSourceNode()].name;
144 const auto& dstPass = pGraph->mNodeData[pGraph->mpGraph->getEdge(edge.first)->getDestNode()].name;
145 std::string src = srcPass + (edgeData.srcField.size() ? '.' + edgeData.srcField : edgeData.srcField);
146 std::string dst = dstPass + (edgeData.dstField.size() ? '.' + edgeData.dstField : edgeData.dstField);
147 ir.addEdge(src, dst);
148 }
149
150 // Graph outputs
151 for (const auto& out : pGraph->mOutputs)
152 {
153 std::string str = pGraph->mNodeData[out.nodeId].name + '.' + out.field;
154 for (auto mask : out.masks)
155 {
156 ir.markOutput(str, mask);
157 }
158 }
159
160 return ir.getIR();
161}
162
163bool RenderGraphExporter::save(const ref<RenderGraph>& pGraph, std::filesystem::path path)
164{

Callers 1

updateGraphMethod · 0.80

Calls 10

getSourceNodeMethod · 0.80
getDestNodeMethod · 0.80
getNameMethod · 0.45
createPassMethod · 0.45
getTypeMethod · 0.45
getPropertiesMethod · 0.45
getEdgeMethod · 0.45
sizeMethod · 0.45
addEdgeMethod · 0.45
markOutputMethod · 0.45

Tested by

no test coverage detected