mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
authorBrian Paul <brianp@vmware.com>
Thu, 13 Jan 2011 01:14:14 +0000 (18:14 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 13 Jan 2011 01:14:18 +0000 (18:14 -0700)
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

src/mesa/main/fbobject.c

index 3e7fd9cf0ec90d032d0547f336b593abacfd3e0d..e3aefe9b85584288f2380e1fd60cd2857a819b43 100644 (file)
@@ -1924,6 +1924,13 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
                      " renderbuffer %u)", renderbuffer);
         return;
       }
+      else if (rb == &DummyRenderbuffer) {
+         /* This is what NVIDIA does */
+        _mesa_error(ctx, GL_INVALID_VALUE,
+                    "glFramebufferRenderbufferEXT(renderbuffer %u)",
+                     renderbuffer);
+        return;
+      }
    }
    else {
       /* remove renderbuffer attachment */