| 132 | } |
| 133 | |
| 134 | uint32_t RenderGraph::addPass(const ref<RenderPass>& pPass, const std::string& passName) |
| 135 | { |
| 136 | FALCOR_CHECK(pPass != nullptr, "Added pass must not be null."); |
| 137 | FALCOR_CHECK(getPassIndex(passName) == kInvalidIndex, "Pass name '{}' already exists.", passName); |
| 138 | |
| 139 | uint32_t passIndex = mpGraph->addNode(); |
| 140 | mNameToIndex[passName] = passIndex; |
| 141 | |
| 142 | pPass->mPassChangedCB = [this]() { mRecompile = true; }; |
| 143 | pPass->mName = passName; |
| 144 | |
| 145 | if (mpScene) |
| 146 | pPass->setScene(mpDevice->getRenderContext(), mpScene); |
| 147 | mNodeData[passIndex] = {passName, pPass}; |
| 148 | mRecompile = true; |
| 149 | return passIndex; |
| 150 | } |
| 151 | |
| 152 | void RenderGraph::removePass(const std::string& name) |
| 153 | { |