Ver código fonte

more debugging

David Rose 18 anos atrás
pai
commit
edebdbae9d

+ 4 - 0
panda/src/display/graphicsStateGuardian.cxx

@@ -1992,6 +1992,10 @@ free_pointers() {
 ////////////////////////////////////////////////////////////////////
 void GraphicsStateGuardian::
 close_gsg() {
+  if (display_cat.is_debug()) {
+    display_cat.debug()
+      << this << " close_gsg " << get_type() << "\n";
+  }
   _closing_gsg = true;
   free_pointers();
 

+ 15 - 2
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -96,6 +96,11 @@ DXGraphicsStateGuardian9::
 DXGraphicsStateGuardian9(GraphicsPipe *pipe) :
   GraphicsStateGuardian(CS_yup_left, pipe)
 {
+  if (dxgsg9_cat.is_debug()) {
+    dxgsg9_cat.debug()
+      << "DXGraphicsStateGuardian9 " << this << " constructing\n";
+  }
+
   _screen = NULL;
   _d3d_device = NULL;
 
@@ -159,8 +164,10 @@ DXGraphicsStateGuardian9(GraphicsPipe *pipe) :
 ////////////////////////////////////////////////////////////////////
 DXGraphicsStateGuardian9::
 ~DXGraphicsStateGuardian9() {
-  dxgsg9_cat.debug()
-    << "DXGraphicsStateGuardian9 " << this << " destructing\n";
+  if (dxgsg9_cat.is_debug()) {
+    dxgsg9_cat.debug()
+      << "DXGraphicsStateGuardian9 " << this << " destructing\n";
+  }
 
   if (IS_VALID_PTR(_d3d_device)) {
     _d3d_device->SetTexture(0, NULL);  // this frees reference to the old texture
@@ -4057,6 +4064,12 @@ void DXGraphicsStateGuardian9::
 close_gsg() {
   GraphicsStateGuardian::close_gsg();
 
+  if (dxgsg9_cat.is_debug()) {
+    dxgsg9_cat.debug()
+      << "Closing GSG, prepared_objects count = " 
+      << _prepared_objects->get_ref_count() << "\n";
+  }
+
   // Unlike in OpenGL, in DX9 it is safe to try to explicitly release
   // any textures here.  And it may even be a good idea.
   if (_prepared_objects->get_ref_count() == 1) {

+ 5 - 0
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -258,6 +258,11 @@ CLP(GraphicsStateGuardian)(GraphicsPipe *pipe) :
 ////////////////////////////////////////////////////////////////////
 CLP(GraphicsStateGuardian)::
 ~CLP(GraphicsStateGuardian)() {
+  if (GLCAT.is_debug()) {
+    GLCAT.debug()
+      << "GLGraphicsStateGuardian " << this << " destructing\n";
+  }
+
   close_gsg();
 
   if (_stencil_render_states) {