mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
everything outside of GraphicsEngine::render_frame() is deemed Show Code for pstats
This commit is contained in:
parent
f1ef8df820
commit
82385a51d0
@ -39,6 +39,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CPPPARSER
|
#ifndef CPPPARSER
|
||||||
|
PStatCollector GraphicsEngine::_show_code_pcollector("App:Show Code");
|
||||||
PStatCollector GraphicsEngine::_cull_pcollector("Cull");
|
PStatCollector GraphicsEngine::_cull_pcollector("Cull");
|
||||||
PStatCollector GraphicsEngine::_draw_pcollector("Draw");
|
PStatCollector GraphicsEngine::_draw_pcollector("Draw");
|
||||||
PStatCollector GraphicsEngine::_sync_pcollector("Draw:Sync");
|
PStatCollector GraphicsEngine::_sync_pcollector("Draw:Sync");
|
||||||
@ -90,6 +91,10 @@ GraphicsEngine(Pipeline *pipeline) :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
GraphicsEngine::
|
GraphicsEngine::
|
||||||
~GraphicsEngine() {
|
~GraphicsEngine() {
|
||||||
|
if (_show_code_pcollector.is_active()) {
|
||||||
|
_show_code_pcollector.stop();
|
||||||
|
}
|
||||||
|
|
||||||
remove_all_windows();
|
remove_all_windows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,6 +346,12 @@ is_empty() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void GraphicsEngine::
|
void GraphicsEngine::
|
||||||
render_frame() {
|
render_frame() {
|
||||||
|
// Anything that happens outside of GraphicsEngine::render_frame()
|
||||||
|
// is deemed to be show code.
|
||||||
|
if (_show_code_pcollector.is_active()) {
|
||||||
|
_show_code_pcollector.stop();
|
||||||
|
}
|
||||||
|
|
||||||
// We hold the GraphicsEngine mutex while we wait for all of the
|
// We hold the GraphicsEngine mutex while we wait for all of the
|
||||||
// threads. Doing this puts us at risk for deadlock if any of the
|
// threads. Doing this puts us at risk for deadlock if any of the
|
||||||
// threads tries to call any methods on the GraphicsEngine. So
|
// threads tries to call any methods on the GraphicsEngine. So
|
||||||
@ -403,6 +414,10 @@ render_frame() {
|
|||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
select(0, NULL, NULL, NULL, &tv);
|
select(0, NULL, NULL, NULL, &tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Anything that happens outside of GraphicsEngine::render_frame()
|
||||||
|
// is deemed to be show code.
|
||||||
|
_show_code_pcollector.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -192,6 +192,7 @@ private:
|
|||||||
FlipState _flip_state;
|
FlipState _flip_state;
|
||||||
Mutex _lock;
|
Mutex _lock;
|
||||||
|
|
||||||
|
static PStatCollector _show_code_pcollector;
|
||||||
static PStatCollector _cull_pcollector;
|
static PStatCollector _cull_pcollector;
|
||||||
static PStatCollector _draw_pcollector;
|
static PStatCollector _draw_pcollector;
|
||||||
static PStatCollector _sync_pcollector;
|
static PStatCollector _sync_pcollector;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user