r300g: put textures with usage=staging in GTT and make them linear
authorMarek Olšák <maraeo@gmail.com>
Thu, 7 Feb 2013 03:29:42 +0000 (04:29 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 7 Feb 2013 16:43:19 +0000 (17:43 +0100)
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r300/r300_texture_desc.c

index e4cb967e9f393e3b0679659b98d92cc1904e009f..d9657306c88c66ad52a2e35c13b680de96685e8f 100644 (file)
@@ -998,7 +998,8 @@ r300_texture_create_object(struct r300_screen *rscreen,
     tex->tex.microtile = microtile;
     tex->tex.macrotile[0] = macrotile;
     tex->tex.stride_in_bytes_override = stride_in_bytes_override;
-    tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ? RADEON_DOMAIN_GTT :
+    tex->domain = (base->flags & R300_RESOURCE_FLAG_TRANSFER ||
+                   base->usage == PIPE_USAGE_STAGING) ? RADEON_DOMAIN_GTT :
                   base->nr_samples > 1 ? RADEON_DOMAIN_VRAM :
                                          RADEON_DOMAIN_VRAM | RADEON_DOMAIN_GTT;
     tex->buf = buffer;
index eb31f82f9d64c180b70ecd34d62c40cc263c9b83..df24e44b209a715ef4e4bc77100a4849212538ca 100644 (file)
@@ -477,6 +477,10 @@ static void r300_setup_tiling(struct r300_screen *screen,
     tex->tex.microtile = RADEON_LAYOUT_LINEAR;
     tex->tex.macrotile[0] = RADEON_LAYOUT_LINEAR;
 
+    if (tex->b.b.usage == PIPE_USAGE_STAGING) {
+       return;
+    }
+
     if (!util_format_is_plain(format)) {
         return;
     }