more debugging

This commit is contained in:
David Rose 2007-04-27 17:05:10 +00:00
parent e893ad14be
commit edebdbae9d
3 changed files with 24 additions and 2 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -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) {