summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-07-09 20:22:20 +0200
committerMarek Olšák <maraeo@gmail.com>2010-07-09 20:28:13 +0200
commit347c00c46e9ecf858a8c21abf58a706b658b5b37 (patch)
tree33f175c56d34e122e4b9154de3baac4d96cf5206 /src/gallium/drivers/r300/r300_texture.c
parent8a8e311d8c3c60982d101826a4aa013672730e6c (diff)
r300g: allow the GTT domain for samplers
This fixes sluggishness in vdrift.
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r--src/gallium/drivers/r300/r300_texture.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 094f22dd37..d378a7150d 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -1001,8 +1001,9 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
tex->size,
util_format_short_name(base->format));
- tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ? R300_DOMAIN_GTT :
- R300_DOMAIN_VRAM;
+ tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ?
+ R300_DOMAIN_GTT :
+ R300_DOMAIN_VRAM | R300_DOMAIN_GTT;
tex->buffer = rws->buffer_create(rws, 2048, base->bind, tex->domain,
tex->size);
@@ -1044,7 +1045,12 @@ struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
surface->base.level = level;
surface->buffer = tex->buffer;
+
+ /* Prefer VRAM if there are multiple domains to choose from. */
surface->domain = tex->domain;
+ if (surface->domain & R300_DOMAIN_VRAM)
+ surface->domain &= ~R300_DOMAIN_GTT;
+
surface->offset = r300_texture_get_offset(tex, level, zslice, face);
surface->pitch = tex->fb_state.pitch[level];
surface->format = tex->fb_state.format;