Browse Source

Remove releasing of d3d texture since Panda already manages releasing of textures.

aignacio_sf 19 years ago
parent
commit
0d8e519699
2 changed files with 4 additions and 32 deletions
  1. 1 15
      panda/src/dxgsg8/wdxGraphicsBuffer8.cxx
  2. 3 17
      panda/src/dxgsg9/wdxGraphicsBuffer9.cxx

+ 1 - 15
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) {

+ 3 - 17
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;
   }