diff --git a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx index f73f803564..1c25372f05 100644 --- a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx @@ -366,21 +366,7 @@ close_buffer() { DXGraphicsStateGuardian8 *dxgsg; DCAST_INTO_V(dxgsg, _gsg); - DXTextureContext8 *dx_texture_context8; - - dx_texture_context8 = _dx_texture_context8; - if (dx_texture_context8) { - // release render texture - if (dx_texture_context8 -> _d3d_texture) { - dx_texture_context8 -> _d3d_texture -> Release ( ); - } - dx_texture_context8 -> _d3d_texture = NULL; - dx_texture_context8 -> _d3d_2d_texture = NULL; - dx_texture_context8 -> _d3d_volume_texture = NULL; - dx_texture_context8 -> _d3d_cube_texture = NULL; - - _dx_texture_context8 = NULL; - } + _dx_texture_context8 = NULL; // release new depth stencil buffer if one was created if (this -> _new_z_stencil_surface) { diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index 8a2efdc3fe..39bc41a0e7 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -92,7 +92,7 @@ begin_frame(FrameMode mode, Thread *current_thread) { begin_render_texture(); clear_cube_map_selection(); } - + _gsg->set_current_properties(&get_fb_properties()); return _gsg->begin_frame(current_thread); } @@ -402,28 +402,14 @@ close_buffer() { DXGraphicsStateGuardian9 *dxgsg; DCAST_INTO_V(dxgsg, _gsg); - DXTextureContext9 *dx_texture_context9; - - dx_texture_context9 = _dx_texture_context9; - if (dx_texture_context9) { - // release render texture - if (dx_texture_context9 -> _d3d_texture) { - dx_texture_context9 -> _d3d_texture -> Release ( ); - } - dx_texture_context9 -> _d3d_texture = NULL; - dx_texture_context9 -> _d3d_2d_texture = NULL; - dx_texture_context9 -> _d3d_volume_texture = NULL; - dx_texture_context9 -> _d3d_cube_texture = NULL; - - _dx_texture_context9 = NULL; - } + _dx_texture_context9 = NULL; // release new depth stencil buffer if one was created if (this -> _new_z_stencil_surface) { this -> _new_z_stencil_surface -> Release ( ); this -> _new_z_stencil_surface = NULL; } - + _gsg.clear(); _active = false; }