From 5e27cd46c04a9e7b5904cc014bffd0f4daae31fe Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 4 Mar 2009 11:58:48 +0100 Subject: gallium: Unify reference counting. The core reference counting code is centralized in p_refcnt.h. This has some consequences related to struct pipe_buffer: * The screen member of struct pipe_buffer must be initialized, or pipe_buffer_reference() will crash trying to destroy a buffer with reference count 0. u_simple_screen takes care of this, but I may have missed some of the drivers not using it. * Except for rare exceptions deep in winsys code, buffers must always be allocated via pipe_buffer_create() or via screen->*buffer_create() rather than via winsys->*buffer_create(). --- src/mesa/state_tracker/st_texture.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/state_tracker/st_texture.c') diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index fcf76ef82e..79a4bd84d0 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -108,7 +108,7 @@ st_texture_create(struct st_context *st, newtex = screen->texture_create(screen, &pt); - assert(!newtex || newtex->refcount == 1); + assert(!newtex || newtex->reference.count == 1); return newtex; } @@ -219,7 +219,7 @@ st_texture_image_unmap(struct st_context *st, screen->transfer_unmap(screen, stImage->transfer); - screen->tex_transfer_release(screen, &stImage->transfer); + screen->tex_transfer_destroy(stImage->transfer); } @@ -284,7 +284,7 @@ st_texture_image_data(struct pipe_context *pipe, 0, 0, /* source x, y */ dst->width[level], dst->height[level]); /* width, height */ - screen->tex_transfer_release(screen, &dst_transfer); + screen->tex_transfer_destroy(dst_transfer); srcUB += src_image_stride; } @@ -350,8 +350,8 @@ st_texture_image_copy(struct pipe_context *pipe, 0, 0, /* srcX, Y */ width, height); - screen->tex_surface_release(screen, &src_surface); - screen->tex_surface_release(screen, &dst_surface); + pipe_surface_reference(&src_surface, NULL); + pipe_surface_reference(&dst_surface, NULL); } } -- cgit v1.2.3