Module: Mesa
Branch: master
Commit: a0996447559bd251ef7f089165405fcdefe79cc5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a0996447559bd251ef7f089165405fcdefe79cc5

Author: Eric Anholt <[email protected]>
Date:   Mon Dec 28 19:09:01 2009 -0800

intel: Fix false positives in checking for non-packed depth/stencil RB.

The wine d3d9 visual.c testcase was tripping over this and failing.
Presumably it's binding a packed depth/stencil texture to both
stencil and depth attachment points, and we make a new renderbuffer
wrapper for each in that case.

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index b5ca418..32c43ae 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -592,13 +592,20 @@ intel_validate_framebuffer(GLcontext *ctx, struct 
gl_framebuffer *fb)
    int i;
 
    if (depthRb && stencilRb && stencilRb != depthRb) {
-      /* we only support combined depth/stencil buffers, not separate
-       * stencil buffers.
-       */
-      DBG("Only supports combined depth/stencil (found %s, %s)\n",
-         depthRb ? _mesa_get_format_name(depthRb->Base.Format): "NULL",
-         stencilRb ? _mesa_get_format_name(stencilRb->Base.Format): "NULL");
-      fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+      if (ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Type == GL_TEXTURE &&
+         ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Type == GL_TEXTURE &&
+         (ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Texture->Name ==
+          ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Texture->Name)) {
+        /* OK */
+      } else {
+        /* we only support combined depth/stencil buffers, not separate
+         * stencil buffers.
+         */
+        DBG("Only supports combined depth/stencil (found %s, %s)\n",
+            depthRb ? _mesa_get_format_name(depthRb->Base.Format): "NULL",
+            stencilRb ? _mesa_get_format_name(stencilRb->Base.Format): "NULL");
+        fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+      }
    }
 
    for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to