gallium: Make sure to release texture surfaces (at the right time).
authorMichel Dänzer <michel@tungstengraphics.com>
Tue, 6 May 2008 11:24:04 +0000 (12:24 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 6 May 2008 11:24:04 +0000 (12:24 +0100)
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_texture.c

index 8c775ad8864e3b21a66487e2e3dbeea3dee6e1ae..6ec3c343cdab0c6a9ee077b11786e34bc2dc53c8 100644 (file)
@@ -1038,12 +1038,13 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
       }
    }
 
+   pipe_surface_reference(&psTex, NULL);
+
    /* draw textured quad */
    draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],
                       width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
                       pt, stvp, stfp, color, GL_TRUE);
 
-   pipe_surface_reference(&psTex, NULL);
    pipe_texture_reference(&pt, NULL);
 }
 
index 2b587a0848190f85675e8b9bb84940ce18f39958..1a1ab99f238a81b26a9ab34a67d560b2cb79e96c 100644 (file)
@@ -1095,6 +1095,8 @@ fallback_copy_texsubimage(GLcontext *ctx,
          pipe_put_tile_rgba(pipe, dest_surf, destX, destY, width, 1, data);
       }
    }
+
+   screen->tex_surface_release(screen, &dest_surf);
 }