mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Add CS thread stat counters
This commit is contained in:
parent
d96c5a1076
commit
b02496a8f4
@ -136,9 +136,15 @@ namespace dxvk {
|
|||||||
if (seq == SynchronizeAll)
|
if (seq == SynchronizeAll)
|
||||||
seq = m_chunksDispatched.load();
|
seq = m_chunksDispatched.load();
|
||||||
|
|
||||||
|
auto t0 = dxvk::high_resolution_clock::now();
|
||||||
m_condOnSync.wait(lock, [this, seq] {
|
m_condOnSync.wait(lock, [this, seq] {
|
||||||
return m_chunksExecuted.load() >= 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());
|
chunk->executeAll(m_context.ptr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (const DxvkError& e) {
|
} catch (const DxvkError& e) {
|
||||||
Logger::err("Exception on CS thread!");
|
Logger::err("Exception on CS thread!");
|
||||||
|
@ -20,6 +20,9 @@ namespace dxvk {
|
|||||||
QueueSubmitCount, ///< Number of command buffer submissions
|
QueueSubmitCount, ///< Number of command buffer submissions
|
||||||
QueuePresentCount, ///< Number of present calls / frames
|
QueuePresentCount, ///< Number of present calls / frames
|
||||||
GpuIdleTicks, ///< GPU idle time in microseconds
|
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
|
NumCounters, ///< Number of counters available
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user