From dd973cd9e81abf1c0bc1880c7905f3277d4361a0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 12 Jan 2011 18:14:14 -0700 Subject: [PATCH] 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. --- src/mesa/main/fbobject.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 3e7fd9c..e3aefe9 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -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 */ -- 2.7.4