mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
track number of cyclers in PStats
This commit is contained in:
parent
863cac3baf
commit
0a0377607d
@ -59,6 +59,8 @@ PStatCollector GraphicsEngine::_transform_states_pcollector("TransformStates");
|
|||||||
PStatCollector GraphicsEngine::_transform_states_unused_pcollector("TransformStates:Unused");
|
PStatCollector GraphicsEngine::_transform_states_unused_pcollector("TransformStates:Unused");
|
||||||
PStatCollector GraphicsEngine::_render_states_pcollector("RenderStates");
|
PStatCollector GraphicsEngine::_render_states_pcollector("RenderStates");
|
||||||
PStatCollector GraphicsEngine::_render_states_unused_pcollector("RenderStates:Unused");
|
PStatCollector GraphicsEngine::_render_states_unused_pcollector("RenderStates:Unused");
|
||||||
|
PStatCollector GraphicsEngine::_cyclers_pcollector("PipelineCyclers");
|
||||||
|
PStatCollector GraphicsEngine::_dirty_cyclers_pcollector("PipelineCyclers:Dirty");
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: GraphicsEngine::Constructor
|
// Function: GraphicsEngine::Constructor
|
||||||
@ -537,6 +539,11 @@ render_frame() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(DO_PIPELINING) && defined(HAVE_THREADS)
|
||||||
|
_cyclers_pcollector.set_level(_pipeline->get_num_cyclers());
|
||||||
|
_dirty_cyclers_pcollector.set_level(_pipeline->get_num_dirty_cyclers());
|
||||||
|
#endif // DO_PIPELINING && HAVE_THREADS
|
||||||
|
|
||||||
// Now cycle the pipeline and officially begin the next frame.
|
// Now cycle the pipeline and officially begin the next frame.
|
||||||
{
|
{
|
||||||
PStatTimer timer(_cycle_pcollector);
|
PStatTimer timer(_cycle_pcollector);
|
||||||
|
@ -259,6 +259,8 @@ private:
|
|||||||
static PStatCollector _transform_states_unused_pcollector;
|
static PStatCollector _transform_states_unused_pcollector;
|
||||||
static PStatCollector _render_states_pcollector;
|
static PStatCollector _render_states_pcollector;
|
||||||
static PStatCollector _render_states_unused_pcollector;
|
static PStatCollector _render_states_unused_pcollector;
|
||||||
|
static PStatCollector _cyclers_pcollector;
|
||||||
|
static PStatCollector _dirty_cyclers_pcollector;
|
||||||
|
|
||||||
friend class WindowRenderer;
|
friend class WindowRenderer;
|
||||||
friend class GraphicsOutput;
|
friend class GraphicsOutput;
|
||||||
|
@ -211,6 +211,8 @@ static LevelCollectorProperties level_properties[] = {
|
|||||||
{ 1, "RenderStates:On nodes", { 0.2, 0.8, 1.0 } },
|
{ 1, "RenderStates:On nodes", { 0.2, 0.8, 1.0 } },
|
||||||
{ 1, "RenderStates:Cached", { 1.0, 0.0, 0.2 } },
|
{ 1, "RenderStates:Cached", { 1.0, 0.0, 0.2 } },
|
||||||
{ 1, "RenderStates:Unused", { 0.2, 0.2, 0.2 } },
|
{ 1, "RenderStates:Unused", { 0.2, 0.2, 0.2 } },
|
||||||
|
{ 1, "PipelineCyclers", { 0.5, 0.5, 1.0 }, "", 5000 },
|
||||||
|
{ 1, "PipelineCyclers:Dirty", { 0.2, 0.2, 0.2 } },
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,3 +51,34 @@ INLINE int Pipeline::
|
|||||||
get_num_stages() const {
|
get_num_stages() const {
|
||||||
return _num_stages;
|
return _num_stages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(DO_PIPELINING) && defined(HAVE_THREADS)
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Pipeline::get_num_cyclers
|
||||||
|
// Access: Public
|
||||||
|
// Description: Returns the number of PipelineCyclers in the universe
|
||||||
|
// that reference this Pipeline object.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE int Pipeline::
|
||||||
|
get_num_cyclers() const {
|
||||||
|
ReMutexHolder holder(_lock);
|
||||||
|
return _cyclers.size();
|
||||||
|
}
|
||||||
|
#endif // DO_PIPELINING && HAVE_THREADS
|
||||||
|
|
||||||
|
#if defined(DO_PIPELINING) && defined(HAVE_THREADS)
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Pipeline::get_num_dirty_cyclers
|
||||||
|
// Access: Public
|
||||||
|
// Description: Returns the number of PipelineCyclers in the universe
|
||||||
|
// that reference this Pipeline object and are currently
|
||||||
|
// marked "dirty"; that is, there is a difference in
|
||||||
|
// pointer value between some of their stages.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE int Pipeline::
|
||||||
|
get_num_dirty_cyclers() const {
|
||||||
|
ReMutexHolder holder(_lock);
|
||||||
|
return _dirty_cyclers.size();
|
||||||
|
}
|
||||||
|
#endif // DO_PIPELINING && HAVE_THREADS
|
||||||
|
|
||||||
|
@ -56,6 +56,9 @@ public:
|
|||||||
void add_cycler(PipelineCyclerTrueImpl *cycler);
|
void add_cycler(PipelineCyclerTrueImpl *cycler);
|
||||||
void add_dirty_cycler(PipelineCyclerTrueImpl *cycler);
|
void add_dirty_cycler(PipelineCyclerTrueImpl *cycler);
|
||||||
void remove_cycler(PipelineCyclerTrueImpl *cycler);
|
void remove_cycler(PipelineCyclerTrueImpl *cycler);
|
||||||
|
|
||||||
|
INLINE int get_num_cyclers() const;
|
||||||
|
INLINE int get_num_dirty_cyclers() const;
|
||||||
#endif // DO_PIPELINING && HAVE_THREADS
|
#endif // DO_PIPELINING && HAVE_THREADS
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user