From 20774b09acc957833b11b63b3ff7d44d92c536d9 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 31 Jul 2001 21:42:59 +0000 Subject: [PATCH] time state changes --- panda/src/display/graphicsStateGuardian.cxx | 14 ++++++++++---- panda/src/pstatclient/pStatProperties.cxx | 7 ++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 130a557a18..af62a7e40e 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -20,12 +20,14 @@ #include "graphicsStateGuardian.h" #include "config_display.h" #include "textureContext.h" -#include - -#include -#include #include "renderBuffer.h" +#include "clockObject.h" +#include "geomNode.h" +#include "pStatTimer.h" + +#include + #ifndef CPPPARSER PStatCollector GraphicsStateGuardian::_total_texusage_pcollector("Texture usage"); 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_transforms_pcollector("Cull volumes:Transforms"); +static PStatCollector _set_state_pcollector("Draw:Set state"); + #endif TypeHandle GraphicsStateGuardian::_type_handle; @@ -141,6 +145,8 @@ reset() { //////////////////////////////////////////////////////////////////// void GraphicsStateGuardian:: set_state(const NodeAttributes &new_state, bool complete) { + PStatTimer timer(_set_state_pcollector); + if (gsg_cat.is_debug()) { gsg_cat.debug() << "\n"; gsg_cat.debug() diff --git a/panda/src/pstatclient/pStatProperties.cxx b/panda/src/pstatclient/pStatProperties.cxx index 9e27b77538..f2b999d1c0 100644 --- a/panda/src/pstatclient/pStatProperties.cxx +++ b/panda/src/pstatclient/pStatProperties.cxx @@ -128,13 +128,14 @@ static TimeCollectorProperties time_properties[] = { { 0, "Cull:Bins:Unsorted", { 0.5, 0.5, 1.0 } }, { 0, "Cull:Bins:Fixed", { 0.5, 1.0, 0.5 } }, { 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:Direct", { 0.0, 0.4, 1.0 } }, { 1, "Draw:Cull", { 0.4, 1.0, 0.0 } }, { 1, "Draw:Swap buffers", { 0.5, 1.0, 0.8 } }, - { 1, "Draw:Clear", { 0.5, 0.7, 0.7 } }, - { 1, "Draw:Show fps", { 0.5, 0.8, 1.0 } }, - { 1, "Draw:Make current", { 1.0, 0.6, 0.3 } }, + { 0, "Draw:Clear", { 0.5, 0.7, 0.7 } }, + { 0, "Draw:Show fps", { 0.5, 0.8, 1.0 } }, + { 0, "Draw:Make current", { 1.0, 0.6, 0.3 } }, { 0, "WRT", { 0.0, 0.0, 1.0 } }, { 0, "WRT:Subtree", { 0.3, 1.0, 0.3 } }, { 0, NULL }