intel: When validating an FBO's combined depth/stencil, use the given FBO.
authorEric Anholt <eric@anholt.net>
Tue, 4 Jan 2011 18:00:51 +0000 (10:00 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 4 Jan 2011 18:04:19 +0000 (10:04 -0800)
We were looking at the current draw buffer instead to see whether the
depth/stencil combination matched.  So you'd get told your framebuffer
was complete, until you bound it and went to draw and we decided that
it was incomplete.

src/mesa/drivers/dri/intel/intel_fbo.c

index 9d33ad1..a47d2d4 100644 (file)
@@ -571,10 +571,10 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
    int i;
 
    if (depthRb && stencilRb && stencilRb != depthRb) {
-      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)) {
+      if (fb->Attachment[BUFFER_DEPTH].Type == GL_TEXTURE &&
+         fb->Attachment[BUFFER_STENCIL].Type == GL_TEXTURE &&
+         (fb->Attachment[BUFFER_DEPTH].Texture->Name ==
+          fb->Attachment[BUFFER_STENCIL].Texture->Name)) {
         /* OK */
       } else {
         /* we only support combined depth/stencil buffers, not separate