mesa: Don't reuse DummyFramebuffer as the incomplete framebuffer

Binding framebuffer 0 on a context that doesn't have a winsys drawable
will try to bind the incomplete framebuffer.  That fails when that's
also the dummy framebuffer.
This commit is contained in:
Kristian Høgsberg
2010-09-09 17:08:12 -04:00
parent 7aae70406b
commit 144356f992
2 changed files with 10 additions and 1 deletions

View File

@@ -71,6 +71,10 @@
static struct gl_framebuffer DummyFramebuffer;
static struct gl_renderbuffer DummyRenderbuffer;
/* We bind this framebuffer when applications pass a NULL
* drawable/surface in make current. */
static struct gl_framebuffer IncompleteFramebuffer;
#define IS_CUBE_FACE(TARGET) \
((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \
@@ -95,14 +99,16 @@ _mesa_init_fbobjects(GLcontext *ctx)
{
_glthread_INIT_MUTEX(DummyFramebuffer.Mutex);
_glthread_INIT_MUTEX(DummyRenderbuffer.Mutex);
_glthread_INIT_MUTEX(IncompleteFramebuffer.Mutex);
DummyFramebuffer.Delete = delete_dummy_framebuffer;
DummyRenderbuffer.Delete = delete_dummy_renderbuffer;
IncompleteFramebuffer.Delete = delete_dummy_framebuffer;
}
struct gl_framebuffer *
_mesa_get_incomplete_framebuffer(void)
{
return &DummyFramebuffer;
return &IncompleteFramebuffer;
}
/**