st/mesa: don't detach renderbuffer, surface in st_finish_render_texture()
authorBrian Paul <brianp@vmware.com>
Mon, 8 Mar 2010 18:31:23 +0000 (11:31 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 8 Mar 2010 18:39:51 +0000 (11:39 -0700)
There's no reason to release the renderbuffer from the framebuffer object
or release the gallium surface in this function (they're reference counted).
In fact, we don't want to do this because we may later use the texture as a
pixel source (ex: glBlitFramebuffer) and need the surface.

Fixes fd.o bug 26923 and is part of the fix for bug 26932.

src/mesa/state_tracker/st_cb_fbo.c

index 8fded0c69fcecb8440d2bee18f0bd3372f77e7e5..00e9d1dccbdcb63b3e4c06864fc174d15230549e 100644 (file)
@@ -410,17 +410,12 @@ st_finish_render_texture(GLcontext *ctx,
 
    st_flush( ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL );
 
-   if (strb->surface)
-      pipe_surface_reference( &strb->surface, NULL );
-
    strb->rtt = NULL;
 
    /*
    printf("FINISH RENDER TO TEXTURE surf=%p\n", strb->surface);
    */
 
-   _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
-
    /* restore previous framebuffer state */
    st_invalidate_state(ctx, _NEW_BUFFERS);
 }