Expose the runtime from the engine in Stats

This commit is contained in:
samcake 2017-04-18 18:12:42 -07:00
parent 5af171f69f
commit 2c16b2bf3a
3 changed files with 8 additions and 4 deletions

View file

@ -244,16 +244,16 @@ Item {
id: octreeCol
spacing: 4; x: 4; y: 4;
StatText {
text: " Frame timing:"
text: "Engine: " + root.engineFrameTime.toFixed(1) + " ms"
}
StatText {
text: " Batch: " + root.batchFrameTime.toFixed(1) + " ms"
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"
}
StatText {
text: " GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
}
StatText {
text: " Avatar: " + root.avatarSimulationTime.toFixed(1) + " ms"
text: "Avatar: " + root.avatarSimulationTime.toFixed(1) + " ms"
}
StatText {
text: "Triangles: " + root.triangles +

View file

@ -335,6 +335,8 @@ void Stats::updateStats(bool force) {
// Update Frame timing (in ms)
STAT_UPDATE(gpuFrameTime, (float)gpuContext->getFrameTimerGPUAverage());
STAT_UPDATE(batchFrameTime, (float)gpuContext->getFrameTimerBatchAverage());
auto config = qApp->getRenderEngine()->getConfiguration().get();
STAT_UPDATE(engineFrameTime, (float) config->getCPURunTime());
STAT_UPDATE(avatarSimulationTime, (float)avatarManager->getAvatarSimulationTime());

View file

@ -128,6 +128,7 @@ class Stats : public QQuickItem {
STATS_PROPERTY(int, gpuFreeMemory, 0)
STATS_PROPERTY(float, gpuFrameTime, 0)
STATS_PROPERTY(float, batchFrameTime, 0)
STATS_PROPERTY(float, engineFrameTime, 0)
STATS_PROPERTY(float, avatarSimulationTime, 0)
public:
@ -250,6 +251,7 @@ signals:
void gpuFreeMemoryChanged();
void gpuFrameTimeChanged();
void batchFrameTimeChanged();
void engineFrameTimeChanged();
void avatarSimulationTimeChanged();
void rectifiedTextureCountChanged();
void decimatedTextureCountChanged();