|
evan 2026.1.4
Evan
|
Process-wide counter plumbing for the frame statistics. More...
Functions | |
| bool | enabled () noexcept |
| Whether the global counters currently record. | |
| void | setEnabledForTesting (std::optional< bool > state) noexcept |
| Overrides the counter gate. | |
| void | countSync () noexcept |
| Counts one RessourceManager::sync() call. | |
| void | countSyncSkip () noexcept |
| Counts one sync() call short-circuited on the version check. | |
| void | countMeshCreation () noexcept |
| Counts one GPUMesh construction. | |
| void | countMeshDestruction () noexcept |
| Counts one GPUMesh destruction. | |
| void | countUploadWait () noexcept |
| Counts one blocking upload wait (staging or one-time submission fence). | |
| void | takeGlobalDeltas (FrameStats &stats) noexcept |
Folds the global counter deltas into stats. | |
| uint64_t | maskTimestamp (uint64_t value, uint32_t validBits) noexcept |
| Masks a raw timestamp to the device's valid bits. | |
| bool | timestampDeltaNs (uint64_t begin, uint64_t end, float period, uint64_t &deltaNs) noexcept |
| Converts a timestamp delta to nanoseconds. | |
Process-wide counter plumbing for the frame statistics.
The counters live here because their increment sites (RessourceManager, GPUMesh, TransferManager, device backends) have no access to a Renderer's FrameStats. The renderer folds the deltas into its window once per frame through takeGlobalDeltas(). Increments are gated behind the EVAN_STATS flag, so with statistics off each site is one predictable branch.
|
noexcept |
Whether the global counters currently record.
Masks a raw timestamp to the device's valid bits.
Devices whose timestamp counter is narrower than 64 bits leave the high bits undefined; only the low VkPhysicalDeviceLimits::timestampValidBits bits are meaningful.
| value | Raw timestamp counter value. |
| validBits | Number of valid bits reported by the device. |
Definition at line 287 of file FrameStats.hpp.
Overrides the counter gate.
Unit-test hook only: the override is never set by engine code. Pass std::nullopt to fall back to the EVAN_STATS environment variable.
| state | Forced gate value, or std::nullopt for the default. |
|
noexcept |
Folds the global counter deltas into stats.
Adds (current value - last taken value) to the matching counters and moves the snapshot forward, so every increment is accounted exactly once whichever frame reports it.
| stats | The window to update. |
|
inlinenoexcept |
Converts a timestamp delta to nanoseconds.
| begin | First timestamp, already masked. |
| end | Second timestamp, already masked. |
| period | Nanoseconds per tick (VkPhysicalDeviceLimits::timestampPeriod, may be fractional). |
| deltaNs | Receives the converted duration. |
Definition at line 310 of file FrameStats.hpp.

