summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_texture.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-02-04 09:07:08 +1000
committerDave Airlie <[email protected]>2011-02-04 09:09:45 +1000
commit3e9bc43fbafdd497d475eaffe0deec81b446d122 (patch)
tree73d4e41d0470368e109df3f2f15a40db47f00cb9 /src/gallium/drivers/r600/r600_texture.c
parent446bc12c1760fe5d402cdd519a7f0e42d89b9696 (diff)
r600g: add a flag to just create flushed texture without flushing.
This just adds a flag to create the texture without doing any flushing to it. Flushing occurs in the draw function. This avoids unnecessary flushes when we end up rebinding a CB/DB/texture due to the blitter just restoring state. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r--src/gallium/drivers/r600/r600_texture.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index c32e541eb50..bc18eef6cfe 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -488,7 +488,7 @@ struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen,
}
int r600_texture_depth_flush(struct pipe_context *ctx,
- struct pipe_resource *texture)
+ struct pipe_resource *texture, boolean just_create)
{
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
struct pipe_resource resource;
@@ -517,6 +517,9 @@ int r600_texture_depth_flush(struct pipe_context *ctx,
((struct r600_resource_texture *)rtex->flushed_depth_texture)->is_flushing_texture = TRUE;
out:
+ if (just_create)
+ return 0;
+
/* XXX: only do this if the depth texture has actually changed:
*/
r600_blit_uncompress_depth(ctx, rtex);
@@ -582,7 +585,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
*/
/* XXX: when discard is true, no need to read back from depth texture
*/
- r = r600_texture_depth_flush(ctx, texture);
+ r = r600_texture_depth_flush(ctx, texture, FALSE);
if (r < 0) {
R600_ERR("failed to create temporary texture to hold untiled copy\n");
pipe_resource_reference(&trans->transfer.resource, NULL);