time state changes

This commit is contained in:
David Rose 2001-07-31 21:42:59 +00:00
parent e185a67e98
commit 20774b09ac
2 changed files with 14 additions and 7 deletions

View File

@ -20,12 +20,14 @@
#include "graphicsStateGuardian.h" #include "graphicsStateGuardian.h"
#include "config_display.h" #include "config_display.h"
#include "textureContext.h" #include "textureContext.h"
#include <algorithm>
#include <clockObject.h>
#include <geomNode.h>
#include "renderBuffer.h" #include "renderBuffer.h"
#include "clockObject.h"
#include "geomNode.h"
#include "pStatTimer.h"
#include <algorithm>
#ifndef CPPPARSER #ifndef CPPPARSER
PStatCollector GraphicsStateGuardian::_total_texusage_pcollector("Texture usage"); PStatCollector GraphicsStateGuardian::_total_texusage_pcollector("Texture usage");
PStatCollector GraphicsStateGuardian::_active_texusage_pcollector("Texture usage:Active"); PStatCollector GraphicsStateGuardian::_active_texusage_pcollector("Texture usage:Active");
@ -50,6 +52,8 @@ PStatCollector GraphicsStateGuardian::_geom_nodes_pcollector("Nodes:GeomNodes");
PStatCollector GraphicsStateGuardian::_frustum_cull_volumes_pcollector("Cull volumes"); PStatCollector GraphicsStateGuardian::_frustum_cull_volumes_pcollector("Cull volumes");
PStatCollector GraphicsStateGuardian::_frustum_cull_transforms_pcollector("Cull volumes:Transforms"); PStatCollector GraphicsStateGuardian::_frustum_cull_transforms_pcollector("Cull volumes:Transforms");
static PStatCollector _set_state_pcollector("Draw:Set state");
#endif #endif
TypeHandle GraphicsStateGuardian::_type_handle; TypeHandle GraphicsStateGuardian::_type_handle;
@ -141,6 +145,8 @@ reset() {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void GraphicsStateGuardian:: void GraphicsStateGuardian::
set_state(const NodeAttributes &new_state, bool complete) { set_state(const NodeAttributes &new_state, bool complete) {
PStatTimer timer(_set_state_pcollector);
if (gsg_cat.is_debug()) { if (gsg_cat.is_debug()) {
gsg_cat.debug() << "\n"; gsg_cat.debug() << "\n";
gsg_cat.debug() gsg_cat.debug()

View File

@ -128,13 +128,14 @@ static TimeCollectorProperties time_properties[] = {
{ 0, "Cull:Bins:Unsorted", { 0.5, 0.5, 1.0 } }, { 0, "Cull:Bins:Unsorted", { 0.5, 0.5, 1.0 } },
{ 0, "Cull:Bins:Fixed", { 0.5, 1.0, 0.5 } }, { 0, "Cull:Bins:Fixed", { 0.5, 1.0, 0.5 } },
{ 1, "Draw", { 1.0, 0.0, 0.0 }, 1.0 / 30.0 }, { 1, "Draw", { 1.0, 0.0, 0.0 }, 1.0 / 30.0 },
{ 0, "Draw:Set state", { 0.0, 0.0, 0.5 } },
{ 1, "Draw:Quick", { 1.0, 0.0, 0.8 } }, { 1, "Draw:Quick", { 1.0, 0.0, 0.8 } },
{ 1, "Draw:Direct", { 0.0, 0.4, 1.0 } }, { 1, "Draw:Direct", { 0.0, 0.4, 1.0 } },
{ 1, "Draw:Cull", { 0.4, 1.0, 0.0 } }, { 1, "Draw:Cull", { 0.4, 1.0, 0.0 } },
{ 1, "Draw:Swap buffers", { 0.5, 1.0, 0.8 } }, { 1, "Draw:Swap buffers", { 0.5, 1.0, 0.8 } },
{ 1, "Draw:Clear", { 0.5, 0.7, 0.7 } }, { 0, "Draw:Clear", { 0.5, 0.7, 0.7 } },
{ 1, "Draw:Show fps", { 0.5, 0.8, 1.0 } }, { 0, "Draw:Show fps", { 0.5, 0.8, 1.0 } },
{ 1, "Draw:Make current", { 1.0, 0.6, 0.3 } }, { 0, "Draw:Make current", { 1.0, 0.6, 0.3 } },
{ 0, "WRT", { 0.0, 0.0, 1.0 } }, { 0, "WRT", { 0.0, 0.0, 1.0 } },
{ 0, "WRT:Subtree", { 0.3, 1.0, 0.3 } }, { 0, "WRT:Subtree", { 0.3, 1.0, 0.3 } },
{ 0, NULL } { 0, NULL }