summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-05-19 10:04:17 -0600
committerBrian Paul <brianp@vmware.com>2009-05-19 10:04:17 -0600
commit63d1e89138fca3e04896392a9f62e04ee88249fe (patch)
treeb61daf294929bc37a102f65203313c3c88173f8d
parent3ed7e9bfcc7f013518a8d56844b78fb1993687f7 (diff)
mesa: allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT
See sourceforge bug #2793846. (cherry picked from commit 042d9a513213b1fa356c0d80abc62b9327e0bcc2)
-rw-r--r--src/mesa/main/fbobject.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 876d691c65..5a7ba453aa 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -323,6 +323,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 */
}
@@ -332,9 +333,18 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
}
}
else {
- /* no such thing as stencil textures */
- 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->Complete = GL_FALSE;
+ return;
+ }
}
}
else if (att->Type == GL_RENDERBUFFER_EXT) {