Merge branch 'mesa_7_5_branch'
authorBrian Paul <brianp@vmware.com>
Tue, 19 May 2009 16:07:45 +0000 (10:07 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 19 May 2009 16:07:45 +0000 (10:07 -0600)
1  2 
src/mesa/main/fbobject.c

diff --combined src/mesa/main/fbobject.c
index dbd4c5848cc06911dcbec7fc4f678f0cda31ca4d,e8e8c2bf30e53163915020537a8872519bebd571..83301f1e621156369312cddf5fb8e683f84e1631
@@@ -368,17 -368,13 +368,18 @@@ test_attachment_completeness(const GLco
              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) {
              /* OK */
           }
           else if (ctx->Extensions.EXT_packed_depth_stencil &&
+                   ctx->Extensions.ARB_depth_texture &&
                    texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) {
              /* OK */
           }
           }
        }
        else {
-          /* no such thing as stencil textures */
-          att_incomplete("illegal stencil texture");
-          att->Complete = GL_FALSE;
-          return;
+          ASSERT(format == GL_STENCIL);
+          ASSERT(att->Renderbuffer->StencilBits);
+          if (ctx->Extensions.EXT_packed_depth_stencil &&
+              ctx->Extensions.ARB_depth_texture &&
+              att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
+             /* OK */
+          }
+          else {
+             /* no such thing as stencil-only textures */
+             att_incomplete("illegal stencil texture");
+             att->Complete = GL_FALSE;
+             return;
+          }
        }
     }
     else if (att->Type == GL_RENDERBUFFER_EXT) {