From af215348239f82fd5113b794756f98d89008e8e8 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 18 Jul 2007 13:55:24 +0000 Subject: [PATCH] track Draw:Set State --- panda/src/display/graphicsStateGuardian.cxx | 1 + panda/src/display/graphicsStateGuardian.h | 1 + panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 1 + panda/src/pstatclient/pStatProperties.cxx | 1 + 4 files changed, 4 insertions(+) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 642bea5ff8..fea31866d5 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -67,6 +67,7 @@ PStatCollector GraphicsStateGuardian::_state_pcollector("State changes"); PStatCollector GraphicsStateGuardian::_transform_state_pcollector("State changes:Transforms"); PStatCollector GraphicsStateGuardian::_texture_state_pcollector("State changes:Textures"); PStatCollector GraphicsStateGuardian::_draw_primitive_pcollector("Draw:Primitive:Draw"); +PStatCollector GraphicsStateGuardian::_draw_set_state_pcollector("Draw:Set State"); PStatCollector GraphicsStateGuardian::_clear_pcollector("Draw:Clear"); PStatCollector GraphicsStateGuardian::_flush_pcollector("Draw:Flush"); diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index ee56dbd60b..dcb41586fa 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -442,6 +442,7 @@ public: static PStatCollector _transform_state_pcollector; static PStatCollector _texture_state_pcollector; static PStatCollector _draw_primitive_pcollector; + static PStatCollector _draw_set_state_pcollector; static PStatCollector _clear_pcollector; static PStatCollector _flush_pcollector; static PStatCollector _wait_occlusion_pcollector; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 74ea9d4842..59c002a780 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -5787,6 +5787,7 @@ set_state_and_transform(const RenderState *target, #endif _state_pcollector.add_level(1); + PStatTimer timer(_draw_set_state_pcollector); if (transform != _internal_transform) { _state_pcollector.add_level(1); diff --git a/panda/src/pstatclient/pStatProperties.cxx b/panda/src/pstatclient/pStatProperties.cxx index 9812e0c8be..153e1b7fbe 100644 --- a/panda/src/pstatclient/pStatProperties.cxx +++ b/panda/src/pstatclient/pStatProperties.cxx @@ -154,6 +154,7 @@ static TimeCollectorProperties time_properties[] = { { 1, "Draw:Flush", { 0.9, 0.2, 0.7 } }, { 1, "Draw:Sync", { 0.5, 0.7, 0.7 } }, { 0, "Draw:Primitive", { 0.0, 0.0, 0.5 } }, + { 0, "Draw:Set State", { 0.2, 0.6, 0.8 } }, { 1, "Draw:Wait occlusion", { 1.0, 0.5, 0.0 } }, { 0, NULL } };