Mesa (master): mesa: update framebuffer status as needed in _mesa_source/ dest_buffer_exists()

Brian Paul brianp at kemper.freedesktop.org
Sat Aug 8 13:31:22 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Aug  7 14:51:59 2009 -0600

mesa: update framebuffer status as needed in _mesa_source/dest_buffer_exists()

---

 src/mesa/main/framebuffer.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 9d9c421..dc79b8c 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -827,8 +827,10 @@ _mesa_source_buffer_exists(GLcontext *ctx, GLenum format)
 {
    const struct gl_renderbuffer_attachment *att = ctx->ReadBuffer->Attachment;
 
-   /* state validation should have already been done */
-   ASSERT(ctx->NewState == 0x0);
+   /* If we don't know the framebuffer status, update it now */
+   if (ctx->ReadBuffer->_Status == 0) {
+      _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
+   }
 
    if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
       return GL_FALSE;
@@ -898,8 +900,10 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format)
 {
    const struct gl_renderbuffer_attachment *att = ctx->DrawBuffer->Attachment;
 
-   /* state validation should have already been done */
-   ASSERT(ctx->NewState == 0x0);
+   /* If we don't know the framebuffer status, update it now */
+   if (ctx->DrawBuffer->_Status == 0) {
+      _mesa_test_framebuffer_completeness(ctx, ctx->DrawBuffer);
+   }
 
    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
       return GL_FALSE;




More information about the mesa-commit mailing list