aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2009-03-04 11:58:48 +0100
committerMichel Dänzer <[email protected]>2009-03-04 11:58:48 +0100
commit5e27cd46c04a9e7b5904cc014bffd0f4daae31fe (patch)
treea57289f14d69f1977dfaee592af908052d726b8c /src/mesa/state_tracker/st_texture.c
parent60041203d5847de8ab71842a6ce5d33d96cc4930 (diff)
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().
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index fcf76ef82e8..79a4bd84d01 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);
}
}