Browse Source

Don't compress textures smaller than 4x4 since texture compression requires a texture size >= 4x4.

aignacio_sf 18 years ago
parent
commit
7c76269c9e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      panda/src/dxgsg8/dxTextureContext8.cxx

+ 4 - 2
panda/src/dxgsg8/dxTextureContext8.cxx

@@ -141,8 +141,10 @@ create_texture(DXScreenData &scrn) {
     case Texture::TT_cube_map:
       // check config setting
       if (compressed_textures) {
-        // no compression for render target textures
-        if (get_texture()->get_render_to_texture() == false) {
+        // no compression for render target textures, or very small
+        // textures
+        if (get_texture()->get_render_to_texture() == false &&
+          orig_width >= 4 && orig_height >= 4) {
           compress_texture = true;
         }
       }