Mesa (7.9): mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()

Brian Paul brianp at kemper.freedesktop.org
Mon Feb 21 17:20:21 PST 2011


Module: Mesa
Branch: 7.9
Commit: 8ad9670866c5c4e4360741f262054502e86d801c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ad9670866c5c4e4360741f262054502e86d801c

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Jan 12 18:14:14 2011 -0700

mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()

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.
(cherry picked from commit dd973cd9e81abf1c0bc1880c7905f3277d4361a0)

---

 src/mesa/main/fbobject.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index a946e3f..cb49828 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1870,6 +1870,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 */



More information about the mesa-commit mailing list