mesa: Mark FBOs with compressed color attachments as FBO-incomplete.
authorEric Anholt <eric@anholt.net>
Fri, 15 May 2009 23:24:59 +0000 (16:24 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 17 Jun 2009 18:06:46 +0000 (11:06 -0700)
Both EXT_fbo and ARB_fbo agree on this.  Fixes a segfault in the metaops
mipmap generation in Intel for SGIS_generate_mipmap of S3TC textures in
Regnum Online.

Bug #21654.
(cherry picked from commit 0307e609aa3e707eeb40051bd664d36f2340ba9b)

src/mesa/main/fbobject.c

index e8e8c2bf30e53163915020537a8872519bebd571..83301f1e621156369312cddf5fb8e683f84e1631 100644 (file)
@@ -368,6 +368,11 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
             att->Complete = GL_FALSE;
             return;
          }
+         if (texImage->TexFormat->TexelBytes == 0) {
+            att_incomplete("compressed internalformat");
+            att->Complete = GL_FALSE;
+            return;
+         }
       }
       else if (format == GL_DEPTH) {
          if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) {