r600g: 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:25:47 +0000 (20:25 +0200)
It kills performance if the resource is linear.

src/gallium/drivers/r600/r600_texture.c

index 6de3d6a8645aae6a2678dc295864a73e25bcb427..1c52ff8c83bf667eb36ea71d76495814be177dfa 100644 (file)
@@ -592,13 +592,6 @@ bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
        return true;
 }
 
-/* Needs adjustment for pixelformat:
- */
-static INLINE unsigned u_box_volume( const struct pipe_box *box )
-{
-       return box->width * box->depth * box->height;
-}
-
 struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                                                struct pipe_resource *texture,
                                                unsigned level,
@@ -622,9 +615,6 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                use_staging_texture = TRUE;
        }
 
-       if ((usage & PIPE_TRANSFER_READ) && u_box_volume(box) > 1024)
-               use_staging_texture = TRUE;
-
        /* Use a staging texture for uploads if the underlying BO is busy. */
        if (!(usage & PIPE_TRANSFER_READ) &&
            (rctx->ws->cs_is_buffer_referenced(rctx->cs, rtex->resource.cs_buf, RADEON_USAGE_READWRITE) ||