r600g: introduce a per-driver resource flag for transfers.
authorDave Airlie <airlied@redhat.com>
Thu, 21 Oct 2010 03:36:01 +0000 (13:36 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 21 Oct 2010 03:36:01 +0000 (13:36 +1000)
this is to be used to decide not to tile a surface being used for transfers.

src/gallium/drivers/r600/r600_resource.h
src/gallium/drivers/r600/r600_texture.c

index 5d9fe8cf9448942cf460a4fd7990a48d3795269a..d152285815c35dc47df204233a550082aee114a1 100644 (file)
@@ -25,6 +25,9 @@
 
 #include "util/u_transfer.h"
 
+/* flag to indicate a resource is to be used as a transfer so should not be tiled */
+#define R600_RESOURCE_FLAG_TRANSFER     PIPE_RESOURCE_FLAG_DRV_PRIV
+
 /* Texture transfer. */
 struct r600_transfer {
        /* Base class. */
index c765c0c87a1e1d01068893083fb1825a3386e902..b0e5cda6010710f5da9c02802afa3a612cabb6e1 100644 (file)
@@ -361,7 +361,7 @@ int r600_texture_depth_flush(struct pipe_context *ctx,
        resource.nr_samples = 0;
        resource.usage = PIPE_USAGE_DYNAMIC;
        resource.bind = 0;
-       resource.flags = 0;
+       resource.flags = R600_RESOURCE_FLAG_TRANSFER;
 
        resource.bind |= PIPE_BIND_DEPTH_STENCIL;
 
@@ -412,7 +412,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                resource.nr_samples = 0;
                resource.usage = PIPE_USAGE_DYNAMIC;
                resource.bind = 0;
-               resource.flags = 0;
+               resource.flags = R600_RESOURCE_FLAG_TRANSFER;
                /* For texture reading, the temporary (detiled) texture is used as
                 * a render target when blitting from a tiled texture. */
                if (usage & PIPE_TRANSFER_READ) {