summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-07-30 10:42:41 -0600
committerBrian Paul <[email protected]>2009-07-30 10:42:46 -0600
commit27fb3ff858f1c5db82fe94fa1ec9f296808c7b27 (patch)
treea0f6491e4c7b8229892c703d84090560be7bd505
parent9c936403de1aa868de1218deb2b93344b0d8d95d (diff)
softpipe: Mark texture dirty when unmapped.
When a texutre transfer is mapped for writing, mark the texture dirty when unmapped. This was done in surface creation, and this commit moves it to happen in texture unmapping. This fixes subtex test in progs/tests/. Signed-off-by: Chia-I Wu <[email protected]>
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 7a533dad9f0..0c773e484b6 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -224,12 +224,6 @@ softpipe_get_tex_surface(struct pipe_screen *screen,
if (ps->usage & PIPE_BUFFER_USAGE_GPU_READ)
ps->usage |= PIPE_BUFFER_USAGE_CPU_READ;
- if (ps->usage & (PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_GPU_WRITE)) {
- /* Mark the surface as dirty. The tile cache will look for this. */
- spt->modified = TRUE;
- }
-
ps->face = face;
ps->level = level;
ps->zslice = zslice;
@@ -376,6 +370,11 @@ softpipe_transfer_unmap(struct pipe_screen *screen,
spt = softpipe_texture(transfer->texture);
pipe_buffer_unmap( screen, spt->buffer );
+
+ if (transfer->usage != PIPE_TRANSFER_READ) {
+ /* Mark the texture as dirty to expire the tile caches. */
+ spt->modified = TRUE;
+ }
}