| 116 | } |
| 117 | |
| 118 | void WarpProfiler::readBackData() |
| 119 | { |
| 120 | if (!mDataWaiting) |
| 121 | return; |
| 122 | |
| 123 | FALCOR_CHECK(!mActive, "WarpProfiler: readBackData() called without preceding before()/end() calls."); |
| 124 | mpFence->wait(); |
| 125 | mHistograms.resize(mBinCount * kWarpSize); |
| 126 | |
| 127 | const uint32_t* data = reinterpret_cast<const uint32_t*>(mpHistogramStagingBuffer->map()); |
| 128 | std::memcpy(mHistograms.data(), data, mHistograms.size() * sizeof(uint32_t)); |
| 129 | mpHistogramStagingBuffer->unmap(); |
| 130 | |
| 131 | mDataWaiting = false; |
| 132 | } |
| 133 | |
| 134 | } // namespace Falcor |