| 71 | } |
| 72 | |
| 73 | void GpuTimer::begin() |
| 74 | { |
| 75 | if (mStatus == Status::Begin) |
| 76 | { |
| 77 | logWarning( |
| 78 | "GpuTimer::begin() was followed by another call to GpuTimer::begin() without a GpuTimer::end() in-between. Ignoring call." |
| 79 | ); |
| 80 | return; |
| 81 | } |
| 82 | |
| 83 | if (mStatus == Status::End) |
| 84 | { |
| 85 | logWarning( |
| 86 | "GpuTimer::begin() was followed by a call to GpuTimer::end() without querying the data first. The previous results will be " |
| 87 | "discarded." |
| 88 | ); |
| 89 | } |
| 90 | |
| 91 | mpDevice->getRenderContext()->getLowLevelData()->getResourceCommandEncoder()->writeTimestamp( |
| 92 | mpDevice->getTimestampQueryHeap()->getGfxQueryPool(), mStart |
| 93 | ); |
| 94 | mStatus = Status::Begin; |
| 95 | } |
| 96 | |
| 97 | void GpuTimer::end() |
| 98 | { |