gallium/radeon: strenghten some checking for DMA preparation
authorMarek Olšák <marek.olsak@amd.com>
Wed, 11 May 2016 12:09:55 +0000 (14:09 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 1 Jun 2016 15:35:30 +0000 (17:35 +0200)
Just for consistency. This doesn't fix anything, because DCC is not
supported with non-mipmapped textures.

v1.1: fix the comment about DCC

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeon/r600_texture.c

index db63bebc676ae0e7e8ea18fd6313ce1e34262619..7a241fedbd08f735a93320c1781c4c3c8b56fdb7 100644 (file)
@@ -74,8 +74,11 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
                return false;
 
        if (rdst->dcc_offset) {
-               /* We can't discard DCC if the texture has been exported. */
+               /* We can't discard DCC if the texture has been exported.
+                * We can only discard DCC for the entire texture.
+                */
                if (rdst->resource.is_shared ||
+                   rdst->resource.b.b.last_level > 0 ||
                    !util_texrange_covers_whole_level(&rdst->resource.b.b, dst_level,
                                                      dstx, dsty, dstz, src_box->width,
                                                      src_box->height, src_box->depth))
@@ -90,6 +93,8 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
         *        SDMA. Otherwise, use the 3D path.
         */
        if (rdst->cmask.size && rdst->dirty_level_mask & (1 << dst_level)) {
+               /* The CMASK clear is only enabled for the first level. */
+               assert(dst_level == 0);
                if (!util_texrange_covers_whole_level(&rdst->resource.b.b, dst_level,
                                                      dstx, dsty, dstz, src_box->width,
                                                      src_box->height, src_box->depth))