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

Method resolve

Source/Falcor/Core/API/GpuTimer.cpp:111–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void GpuTimer::resolve()
112{
113 if (mStatus == Status::Idle)
114 {
115 return;
116 }
117
118 if (mStatus == Status::Begin)
119 {
120 FALCOR_THROW("GpuTimer::resolve() was called but the GpuTimer::end() wasn't called.");
121 }
122
123 FALCOR_ASSERT(mStatus == Status::End);
124
125 // TODO: The code here is inefficient as it resolves each timer individually.
126 // This should be batched across all active timers and results copied into a single staging buffer once per frame instead.
127
128 // Resolve timestamps into buffer.
129 auto encoder = mpDevice->getRenderContext()->getLowLevelData()->getResourceCommandEncoder();
130
131 encoder->resolveQuery(mpDevice->getTimestampQueryHeap()->getGfxQueryPool(), mStart, 2, mpResolveBuffer->getGfxBufferResource(), 0);
132
133 // Copy resolved timestamps to staging buffer for readback. This inserts the necessary barriers.
134 mpDevice->getRenderContext()->copyResource(mpResolveStagingBuffer.get(), mpResolveBuffer.get());
135
136 mDataPending = true;
137 mStatus = Status::Idle;
138}
139
140double GpuTimer::getElapsedTime()
141{

Callers 6

endFrameMethod · 0.45
getStackTraceFunction · 0.45
__init__Method · 0.45
resolve_image_dirMethod · 0.45
jeri.min.jsFile · 0.45

Calls 3

copyResourceMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected