--- src/mesa/main/renderbuffer.c 2007-04-14 16:40:26.000000000 +0200 +++ src/mesa/main/renderbuffer-mod.c 2007-05-16 16:08:14.000000000 +0200 @@ -2073,9 +2073,13 @@ * with the exception of depth/stencil since the same renderbuffer may * be used for both. */ + /* Workaround to mend a hole in via unichrome dri driver : + * remove this assert but add a test if a renderbuffer were attached + * author: pierre.nerzic@free.fr assert(bufferName == BUFFER_DEPTH || bufferName == BUFFER_STENCIL || fb->Attachment[bufferName].Renderbuffer == NULL); + */ /* winsys vs. user-created buffer cross check */ if (fb->Name) { @@ -2085,6 +2089,16 @@ assert(!rb->Name); } + /* was this framebuffer already attached to a renderbuffer ? (via bug) */ + if (bufferName != BUFFER_DEPTH && + bufferName != BUFFER_STENCIL && + fb->Attachment[bufferName].Renderbuffer) { + /* choice (to be compared deeply), comment or not the return */ + return; /* no new renderbuffer, reuse the current one */ + /* second possibility : remove the current buffer before allocation */ + _mesa_remove_renderbuffer(fb,bufferName); + } + /* If Mesa's compiled with deep color channels (16 or 32 bits / channel) * and the device driver is expecting 8-bit values (GLubyte), we can * use a "renderbuffer adaptor/wrapper" to do the necessary conversions.