summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_texture.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-09-23 17:37:28 +0100
committerKeith Whitwell <[email protected]>2009-09-23 17:37:28 +0100
commit890679d4322e7ba4f12f32532a3fdd277edff886 (patch)
tree37df5e8a53f7da9fdcaf2e9660c694e28e14b5bc /src/gallium/drivers/softpipe/sp_texture.c
parenta1fa770c01d913658900de1c267fb4c41bc6300d (diff)
parent75276ea316610a5737f2115326482024aa09d02a (diff)
Merge branch 'softpipe-opt'
Conflicts: progs/demos/cubemap.c src/gallium/drivers/softpipe/sp_tex_sample.c src/gallium/drivers/softpipe/sp_texture.c
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_texture.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 548e40c4a8c..49b51afda7e 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -113,16 +113,20 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
static struct pipe_texture *
softpipe_texture_create(struct pipe_screen *screen,
- const struct pipe_texture *templat)
+ const struct pipe_texture *template)
{
struct softpipe_texture *spt = CALLOC_STRUCT(softpipe_texture);
if (!spt)
return NULL;
- spt->base = *templat;
+ spt->base = *template;
pipe_reference_init(&spt->base.reference, 1);
spt->base.screen = screen;
+ spt->pot = (util_is_power_of_two(template->width[0]) &&
+ util_is_power_of_two(template->height[0]) &&
+ util_is_power_of_two(template->depth[0]));
+
if (spt->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
PIPE_TEXTURE_USAGE_PRIMARY)) {
if (!softpipe_displaytarget_layout(screen, spt))
@@ -218,6 +222,13 @@ 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->timestamp++;
+ softpipe_screen(screen)->timestamp++;
+ }
+
ps->face = face;
ps->level = level;
ps->zslice = zslice;
@@ -366,7 +377,7 @@ softpipe_transfer_unmap(struct pipe_screen *screen,
if (transfer->usage != PIPE_TRANSFER_READ) {
/* Mark the texture as dirty to expire the tile caches. */
- spt->modified = TRUE;
+ spt->timestamp++;
}
}