mesa: Return GL_FRAMEBUFFER_UNDEFINED if the winsys fbo is incomplete.
authorMatt Turner <mattst88@gmail.com>
Fri, 26 Jul 2013 23:36:19 +0000 (16:36 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 29 Jul 2013 17:35:01 +0000 (10:35 -0700)
Specified by ARB_framebuffer_object, GL 3.0, and ES 3.0.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/fbobject.c

index a29f1ab13c0f76930f70fab0d962c829f96f90e4..bf7e85c882631dbfb5c01b5dfe9794315f08bae2 100644 (file)
@@ -2141,8 +2141,12 @@ _mesa_CheckFramebufferStatus(GLenum target)
    }
 
    if (_mesa_is_winsys_fbo(buffer)) {
-      /* The window system / default framebuffer is always complete */
-      return GL_FRAMEBUFFER_COMPLETE_EXT;
+      /* EGL_KHR_surfaceless_context allows the winsys FBO to be incomplete. */
+      if (buffer != &IncompleteFramebuffer) {
+         return GL_FRAMEBUFFER_COMPLETE_EXT;
+      } else {
+         return GL_FRAMEBUFFER_UNDEFINED;
+      }
    }
 
    /* No need to flush here */