[dxvk] Add CS thread stat counters

This commit is contained in:
Philip Rebohle 2022-02-12 20:02:22 +01:00
parent d96c5a1076
commit b02496a8f4
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 12 additions and 1 deletions

View File

@ -136,9 +136,15 @@ namespace dxvk {
if (seq == SynchronizeAll)
seq = m_chunksDispatched.load();
auto t0 = dxvk::high_resolution_clock::now();
m_condOnSync.wait(lock, [this, seq] {
return m_chunksExecuted.load() >= seq;
});
auto t1 = dxvk::high_resolution_clock::now();
auto ticks = std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0);
m_device->addStatCtr(DxvkStatCounter::CsSyncCount, 1);
m_device->addStatCtr(DxvkStatCounter::CsSyncTicks, ticks.count());
}
}
@ -171,8 +177,10 @@ namespace dxvk {
}
}
if (chunk)
if (chunk) {
m_context->addStatCtr(DxvkStatCounter::CsChunkCount, 1);
chunk->executeAll(m_context.ptr());
}
}
} catch (const DxvkError& e) {
Logger::err("Exception on CS thread!");

View File

@ -20,6 +20,9 @@ namespace dxvk {
QueueSubmitCount, ///< Number of command buffer submissions
QueuePresentCount, ///< Number of present calls / frames
GpuIdleTicks, ///< GPU idle time in microseconds
CsSyncCount, ///< CS thread synchronizations
CsSyncTicks, ///< Time spent waiting on CS
CsChunkCount, ///< Submitted CS chunks
NumCounters, ///< Number of counters available
};