Mesa (master): r600: only decompress depth when its tile type is wrong.

Dave Airlie airlied at kemper.freedesktop.org
Tue Feb 1 02:58:20 UTC 2011


Module: Mesa
Branch: master
Commit: aee5f1e40ca27149a6226187e855125821d96971
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aee5f1e40ca27149a6226187e855125821d96971

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Feb  1 13:00:56 2011 +1000

r600: only decompress depth when its tile type is wrong.

If the tile type for the buffer is 1 then its been bound to the
DB at some point, we need to decompress it, otherwise its only
been bound as texture/cb so don't do anything.

This fixes 5 piglit tests here on r600g.

---

 src/gallium/drivers/r600/r600_blit.c    |    6 +++++-
 src/gallium/drivers/r600/r600_state.c   |    2 +-
 src/gallium/drivers/r600/r600_texture.c |    2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index 83c02e5..a8e85df 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -129,7 +129,11 @@ void r600_flush_depth_textures(struct r600_pipe_context *rctx)
 		if (!view) continue;
 
 		tex = (struct r600_resource_texture *)view->base.texture;
-		if (!tex->depth) continue;
+		if (!tex->depth)
+			continue;
+
+		if (tex->tile_type == 0)
+			continue;
 
 		r600_blit_uncompress_depth(&rctx->context, tex);
 	}
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index d23f242..acaa5c0 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -429,7 +429,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
 		R600_ERR("unknow format %d\n", state->format);
 	}
 	tmp = (struct r600_resource_texture *)texture;
-	if (tmp->depth) {
+	if (tmp->depth && tmp->tile_type == 1) {
 		r600_texture_depth_flush(ctx, texture);
 		tmp = tmp->flushed_depth_texture;
 	}
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index e45f4a5..dd28049 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -574,7 +574,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
 	trans->transfer.level = level;
 	trans->transfer.usage = usage;
 	trans->transfer.box = *box;
-	if (rtex->depth) {
+	if (rtex->depth && rtex->tile_type == 1) {
 		/* XXX: only readback the rectangle which is being mapped?
 		*/
 		/* XXX: when discard is true, no need to read back from depth texture




More information about the mesa-commit mailing list