radeonsi: don't use a staging resource for large transfers
authorMarek Olšák <maraeo@gmail.com>
Thu, 13 Sep 2012 18:20:46 +0000 (20:20 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 13 Sep 2012 18:26:21 +0000 (20:26 +0200)
It kills performance if the resource is linear.

src/gallium/drivers/radeonsi/r600_texture.c

index 0b908c8898d9fd885b738bef05571e468c478a05..e6f72c88b058bdcd6b6809d9c4a45b61d22c8288 100644 (file)
@@ -254,13 +254,6 @@ static void r600_texture_destroy(struct pipe_screen *screen,
        FREE(rtex);
 }
 
-/* Needs adjustment for pixelformat:
- */
-static INLINE unsigned u_box_volume( const struct pipe_box *box )
-{
-       return box->width * box->depth * box->height;
-};
-
 static struct pipe_transfer* si_texture_get_transfer(struct pipe_context *ctx,
                                                     struct pipe_resource *texture,
                                                     unsigned level,
@@ -284,9 +277,6 @@ static struct pipe_transfer* si_texture_get_transfer(struct pipe_context *ctx,
            rtex->surface.level[level].mode != RADEON_SURF_MODE_LINEAR)
                use_staging_texture = TRUE;
 
-       if ((usage & PIPE_TRANSFER_READ) && u_box_volume(box) > 1024)
-               use_staging_texture = TRUE;
-
        /* XXX: Use a staging texture for uploads if the underlying BO
         * is busy.  No interface for checking that currently? so do
         * it eagerly whenever the transfer doesn't require a readback