mesa: allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT

See sourceforge bug #2793846.
This commit is contained in:
Mathias Fröhlich
2009-05-19 09:59:01 -06:00
committed by Brian Paul
parent c99a60c40d
commit 042d9a5132
+14 -4
View File
@@ -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) {