summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tile_cache.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-06-20 15:58:19 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-06-20 15:58:19 -0600
commitf38bb109694f2879036c54c97c1c69ea2fecd6c8 (patch)
tree6864232178c87b7abca0cffd4dd8b329adeda84d /src/gallium/drivers/softpipe/sp_tile_cache.c
parent78791d1065c93694a105d4c2cdaee7678a69213a (diff)
gallium: fix some surface usage bugs
When a surface is created with GPU_WRITE that really means "GPU render" and that can involve reads (blending). Set surface usage to PIPE_BUFFER_USAGE_CPU_READ + WRITE. Fixes progs/demos/lodbias demo. Also, mark texture as 'modified' when mapped for writing so that the tile cache can know when to freshen a cached tile. Fixes glTexSubImage2D().
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tile_cache.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 0e4c8c41ee..2d5d2b50f5 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -37,6 +37,7 @@
#include "util/p_tile.h"
#include "sp_context.h"
#include "sp_surface.h"
+#include "sp_texture.h"
#include "sp_tile_cache.h"
#define NUM_ENTRIES 32
@@ -506,6 +507,15 @@ sp_get_cached_tile_tex(struct pipe_context *pipe,
face, level);
struct softpipe_cached_tile *tile = tc->entries + pos;
+ if (tc->texture) {
+ struct softpipe_texture *spt = softpipe_texture(tc->texture);
+ if (spt->modified) {
+ /* texture was modified, force a cache reload */
+ tile->x = -1;
+ spt->modified = FALSE;
+ }
+ }
+
if (tile_x != tile->x ||
tile_y != tile->y ||
z != tile->z ||