From e2f623f1d6da9bc987582ff68d0471061ae44030 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 28 Jul 2012 13:55:59 +0200 Subject: r600g: don't decompress depth or stencil if there isn't any --- src/gallium/drivers/r600/r600_blit.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/r600/r600_blit.c') diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 9c4e911bee0..3623b2e7ae2 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -130,6 +130,8 @@ void r600_blit_uncompress_depth(struct pipe_context *ctx, float depth = 1.0f; struct r600_resource_texture *flushed_depth_texture = staging ? staging : texture->flushed_depth_texture; + const struct util_format_description *desc = + util_format_description(texture->resource.b.b.format); if (!staging && !texture->dirty_db_mask) return; @@ -138,11 +140,11 @@ void r600_blit_uncompress_depth(struct pipe_context *ctx, rctx->family == CHIP_RV620 || rctx->family == CHIP_RV635) depth = 0.0f; - if (!rctx->db_misc_state.flush_depthstencil_through_cb) { - /* Enable decompression in DB_RENDER_CONTROL */ - rctx->db_misc_state.flush_depthstencil_through_cb = true; - r600_atom_dirty(rctx, &rctx->db_misc_state.atom); - } + /* Enable decompression in DB_RENDER_CONTROL */ + rctx->db_misc_state.flush_depthstencil_through_cb = true; + rctx->db_misc_state.copy_depth = util_format_has_depth(desc); + rctx->db_misc_state.copy_stencil = util_format_has_stencil(desc); + r600_atom_dirty(rctx, &rctx->db_misc_state.atom); for (level = first_level; level <= last_level; level++) { if (!staging && !(texture->dirty_db_mask & (1 << level))) -- cgit v1.2.3