Mesa (master): r300g: blit directly to/from GTT when transfering textures

Marek Olšák mareko at kemper.freedesktop.org
Tue Jun 1 21:26:45 PDT 2010


Module: Mesa
Branch: master
Commit: 19498be935328e284c7f0e456fc04cca8d465d4c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=19498be935328e284c7f0e456fc04cca8d465d4c

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Jun  2 06:07:53 2010 +0200

r300g: blit directly to/from GTT when transfering textures

---

 src/gallium/drivers/r300/r300_texture.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 8572334..33aa250 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -918,6 +918,7 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
     struct r300_texture* tex = CALLOC_STRUCT(r300_texture);
     struct r300_screen* rscreen = r300_screen(screen);
     struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys;
+    enum r300_buffer_domain domain;
 
     if (!tex) {
         return NULL;
@@ -959,8 +960,10 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
                base->width0, base->height0, base->depth0, base->last_level,
                util_format_short_name(base->format));
 
-    tex->buffer = rws->buffer_create(rws, 2048, base->bind, R300_DOMAIN_VRAM,
-				     tex->size);
+    domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ? R300_DOMAIN_GTT :
+                                                         R300_DOMAIN_VRAM;
+
+    tex->buffer = rws->buffer_create(rws, 2048, base->bind, domain, tex->size);
 
     rws->buffer_set_tiling(rws, tex->buffer,
             tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),



More information about the mesa-commit mailing list