From c99a60c40d4ece363d37a5af895124f08a645c6b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 19 May 2009 09:57:01 -0600 Subject: mesa: assign trb->Base.StencilBits in update_wrapper(). When we render to a depth/stencil texture there are stencil bits. --- src/mesa/main/texrender.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 49de6f5b8a..cc74d58fbd 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -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; } -- cgit v1.2.3 From 042d9a513213b1fa356c0d80abc62b9327e0bcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= Date: Tue, 19 May 2009 09:59:01 -0600 Subject: mesa: allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT See sourceforge bug #2793846. --- src/mesa/main/fbobject.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 9c5a5908a2..e8e8c2bf30 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -374,6 +374,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 */ } @@ -384,10 +385,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) { -- cgit v1.2.3