Ver código fonte

create texture property in copy_to_texture

David Rose 17 anos atrás
pai
commit
5050c994e0

+ 6 - 0
panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

@@ -1484,6 +1484,12 @@ framebuffer_copy_to_texture(Texture *tex, int z, const DisplayRegion *dr,
     return false;
     return false;
   }
   }
   DXTextureContext8 *dtc = DCAST(DXTextureContext8, tc);
   DXTextureContext8 *dtc = DCAST(DXTextureContext8, tc);
+  if (!dtc->create_texture(*_screen)) {
+    // Oops, we can't re-create the texture for some reason.
+    dxgsg8_cat.error()
+      << "Unable to re-create texture " << *dtc->get_texture() << endl;
+    return false;
+  }
 
 
   if (tex->get_texture_type() != Texture::TT_2d_texture) {
   if (tex->get_texture_type() != Texture::TT_2d_texture) {
     // For a specialty texture like a cube map, go the slow route
     // For a specialty texture like a cube map, go the slow route

+ 6 - 0
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -2138,6 +2138,12 @@ framebuffer_copy_to_texture(Texture *tex, int z, const DisplayRegion *dr,
     return false;
     return false;
   }
   }
   DXTextureContext9 *dtc = DCAST(DXTextureContext9, tc);
   DXTextureContext9 *dtc = DCAST(DXTextureContext9, tc);
+  if (!dtc->create_texture(*_screen)) {
+    // Oops, we can't re-create the texture for some reason.
+    dxgsg9_cat.error()
+      << "Unable to re-create texture " << *dtc->get_texture() << endl;
+    return false;
+  }
 
 
   if (tex->get_texture_type() != Texture::TT_2d_texture) {
   if (tex->get_texture_type() != Texture::TT_2d_texture) {
     // For a specialty texture like a cube map, go the slow route
     // For a specialty texture like a cube map, go the slow route