gallium: fix some surface usage bugs
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 21:58:19 +0000 (15:58 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 21:58:19 +0000 (15:58 -0600)
commitf38bb109694f2879036c54c97c1c69ea2fecd6c8
tree6864232178c87b7abca0cffd4dd8b329adeda84d
parent78791d1065c93694a105d4c2cdaee7678a69213a
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().
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/softpipe/sp_texture.h
src/gallium/drivers/softpipe/sp_tile_cache.c