| 92 | } |
| 93 | |
| 94 | void CaptureTrigger::beginFrame(RenderContext* pRenderContext, const ref<Fbo>& pTargetFbo) |
| 95 | { |
| 96 | RenderGraph* pGraph = mpRenderer->getActiveGraph(); |
| 97 | if (!pGraph) return; |
| 98 | uint64_t frameId = mpRenderer->getGlobalClock().getFrame(); |
| 99 | if (mGraphRanges.find(pGraph) == mGraphRanges.end()) return; |
| 100 | const auto& ranges = mGraphRanges.at(pGraph); |
| 101 | |
| 102 | if (mCurrent.pGraph) |
| 103 | { |
| 104 | FALCOR_ASSERT(pGraph == mCurrent.pGraph); |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | // Check if we need to start a range |
| 109 | for (auto& r : ranges) |
| 110 | { |
| 111 | if (r.first == frameId) |
| 112 | { |
| 113 | mCurrent.pGraph = pGraph; |
| 114 | mCurrent.range = r; |
| 115 | beginRange(pGraph, r); |
| 116 | break; |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | void CaptureTrigger::endFrame(RenderContext* pRenderContext, const ref<Fbo>& pTargetFbo) |
| 122 | { |
nothing calls this directly
no test coverage detected