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)
src/mesa/main/fbobject.c
src/mesa/main/texrender.c

index dbd4c5848cc06911dcbec7fc4f678f0cda31ca4d..83301f1e621156369312cddf5fb8e683f84e1631 100644 (file)
@@ -379,6 +379,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
             /* OK */
          }
          else if (ctx->Extensions.EXT_packed_depth_stencil &&
+                  ctx->Extensions.ARB_depth_texture &&
                   texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) {
             /* OK */
          }
@@ -389,10 +390,19 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
          }
       }
       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) {
index 49de6f5b8abd4ea6a468991f4f16b7fff72543cf..cc74d58fbd181de19cf3f6d47d1ff50855f2de3a 100644 (file)
@@ -507,6 +507,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
    trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits;
    trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits;
    trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits;
+   trb->Base.StencilBits = trb->TexImage->TexFormat->StencilBits;
 }