summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-03-18 10:17:48 -0600
committerBrian Paul <[email protected]>2009-03-18 10:24:19 -0600
commit9808ae688a2386652e178d2bd717d0f380405ae0 (patch)
tree65d85f247124024a10c7277599e0f494a9189890 /src/gallium/drivers/softpipe
parent71e3aa14fb09616a9b06cd6fd01fcabf3853cacd (diff)
softpipe: more texture transfer fixes.
Need to null-out pointers after freeing transfer objects. Fix mix-ups between tc->transfer and tc->tex_trans fields.
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 6db7930ec83..69292753f13 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -246,8 +246,8 @@ sp_tile_cache_set_texture(struct pipe_context *pipe,
pipe_texture_reference(&tc->texture, texture);
- if (tc->transfer) {
- struct pipe_screen *screen = tc->transfer->texture->screen;
+ if (tc->tex_trans) {
+ struct pipe_screen *screen = tc->tex_trans->texture->screen;
if (tc->tex_trans_map) {
screen->transfer_unmap(screen, tc->tex_trans);
@@ -255,6 +255,7 @@ sp_tile_cache_set_texture(struct pipe_context *pipe,
}
screen->tex_transfer_destroy(tc->tex_trans);
+ tc->tex_trans = NULL;
}
/* mark as entries as invalid/empty */
@@ -556,11 +557,14 @@ sp_get_cached_tile_tex(struct softpipe_context *sp,
tc->tex_z != z) {
/* get new transfer (view into texture) */
- if (tc->transfer) {
- if (tc->tex_trans_map)
+ if (tc->tex_trans) {
+ if (tc->tex_trans_map) {
tc->screen->transfer_unmap(tc->screen, tc->tex_trans);
+ tc->tex_trans_map = NULL;
+ }
screen->tex_transfer_destroy(tc->tex_trans);
+ tc->tex_trans = NULL;
}
tc->tex_trans = screen->get_tex_transfer(screen, tc->texture, face, level, z,