Commit 27d750b0 authored by Laszlo Agocs's avatar Laszlo Agocs

examplefw: do not print gpu times when not available

parent 35e9ddc2
......@@ -388,14 +388,23 @@ void Window::render()
const QRhiProfiler::CpuTime ff = m_r->profiler()->frameToFrameTimes(m_sc);
const QRhiProfiler::CpuTime be = m_r->profiler()->frameBuildTimes(m_sc);
const QRhiProfiler::GpuTime gp = m_r->profiler()->gpuFrameTimes(m_sc);
qDebug("ca. %d fps. "
"frame-to-frame: min %lld max %lld avg %f. "
"frame build: min %lld max %lld avg %f. "
"gpu frame time: min %f max %f avg %f",
m_frameCount,
ff.minTime, ff.maxTime, ff.avgTime,
be.minTime, be.maxTime, be.avgTime,
gp.minTime, gp.maxTime, gp.avgTime);
if (m_r->isFeatureSupported(QRhi::Timestamps)) {
qDebug("ca. %d fps. "
"frame-to-frame: min %lld max %lld avg %f. "
"frame build: min %lld max %lld avg %f. "
"gpu frame time: min %f max %f avg %f",
m_frameCount,
ff.minTime, ff.maxTime, ff.avgTime,
be.minTime, be.maxTime, be.avgTime,
gp.minTime, gp.maxTime, gp.avgTime);
} else {
qDebug("ca. %d fps. "
"frame-to-frame: min %lld max %lld avg %f. "
"frame build: min %lld max %lld avg %f. ",
m_frameCount,
ff.minTime, ff.maxTime, ff.avgTime,
be.minTime, be.maxTime, be.avgTime);
}
} else {
qDebug("ca. %d fps", m_frameCount);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment