Add a performance counter for GUI

This commit is contained in:
vlj 2014-06-08 00:20:44 +02:00
parent ed98c4c8ff
commit 94900fe2c8
3 changed files with 10 additions and 5 deletions

View File

@ -125,6 +125,7 @@ enum QueryPerf
Q_BLOOM,
Q_TONEMAP,
Q_MOTIONBLUR,
Q_GUI,
Q_LAST
};

View File

@ -235,10 +235,13 @@ void IrrDriver::renderGLSL(float dt)
PROFILER_POP_CPU_MARKER();
} // for i<getNumKarts
PROFILER_PUSH_CPU_MARKER("GUIEngine", 0x75, 0x75, 0x75);
// Either render the gui, or the global elements of the race gui.
GUIEngine::render(dt);
PROFILER_POP_CPU_MARKER();
{
ScopedGPUTimer Timer(getGPUTimer(Q_GUI));
PROFILER_PUSH_CPU_MARKER("GUIEngine", 0x75, 0x75, 0x75);
// Either render the gui, or the global elements of the race gui.
GUIEngine::render(dt);
PROFILER_POP_CPU_MARKER();
}
// Render the profiler
if(UserConfigParams::m_profiler_enabled)

View File

@ -407,7 +407,8 @@ void Profiler::draw()
"Godrays",
"Bloom",
"Tonemap",
"Motion Blur"
"Motion Blur",
"GUI",
};
std::ostringstream oss;
oss << Phase[hovered_gpu_marker] << " : " << hovered_gpu_marker_elapsed << " us";