mesa: Reenable check for GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 24 May 2010 20:56:12 +0000 (16:56 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 24 May 2010 20:56:56 +0000 (16:56 -0400)
The check was disabled when FEATURE_OES_framebuffer_object was enabled,
since that used to mean we weren't implementing regular OpenGL semantics.
Now that we can compile in support for multiple APIs, change the #ifdef to
compile the check in when FEATURE_GL is enabled and enable the check for
contexts that implement OpenGL at runtime.

src/mesa/main/fbobject.c

index 2376e7f1a54c28cfda1f2cbca94ec8b3efefc586..bf445d2b2990f463491f5d4a9abaeac09a4c6c7a 100644 (file)
@@ -629,30 +629,32 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
       }
    }
 
-#if !FEATURE_OES_framebuffer_object
-   /* Check that all DrawBuffers are present */
-   for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
-      if (fb->ColorDrawBuffer[j] != GL_NONE) {
-         const struct gl_renderbuffer_attachment *att
-            = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
-         assert(att);
-         if (att->Type == GL_NONE) {
-            fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
-            fbo_incomplete("missing drawbuffer", j);
-            return;
-         }
+#if FEATURE_GL
+   if (ctx->API == API_OPENGL) {
+      /* Check that all DrawBuffers are present */
+      for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
+        if (fb->ColorDrawBuffer[j] != GL_NONE) {
+           const struct gl_renderbuffer_attachment *att
+              = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
+           assert(att);
+           if (att->Type == GL_NONE) {
+              fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
+              fbo_incomplete("missing drawbuffer", j);
+              return;
+           }
+        }
       }
-   }
 
-   /* Check that the ReadBuffer is present */
-   if (fb->ColorReadBuffer != GL_NONE) {
-      const struct gl_renderbuffer_attachment *att
-         = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer);
-      assert(att);
-      if (att->Type == GL_NONE) {
-         fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
+      /* Check that the ReadBuffer is present */
+      if (fb->ColorReadBuffer != GL_NONE) {
+        const struct gl_renderbuffer_attachment *att
+           = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer);
+        assert(att);
+        if (att->Type == GL_NONE) {
+           fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
             fbo_incomplete("missing readbuffer", -1);
-         return;
+           return;
+        }
       }
    }
 #else