radeonsi: fix layered DCC fast clear
authorMarek Olšák <marek.olsak@amd.com>
Tue, 28 Nov 2017 19:57:10 +0000 (20:57 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Nov 2017 17:21:30 +0000 (18:21 +0100)
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_texture.c

index 3fa5f5eaa97ef729002477aaf42a6368717f66b3..933a4a9bbe9296d02ac55b871d626890b301b64f 100644 (file)
@@ -2485,8 +2485,11 @@ void vi_dcc_clear_level(struct r600_common_context *rctx,
                assert(rtex->resource.b.b.nr_samples <= 1);
                clear_size = rtex->surface.dcc_size;
        } else {
+               unsigned num_layers = util_max_layer(&rtex->resource.b.b, level) + 1;
+
                dcc_offset += rtex->surface.u.legacy.level[level].dcc_offset;
-               clear_size = rtex->surface.u.legacy.level[level].dcc_fast_clear_size;
+               clear_size = rtex->surface.u.legacy.level[level].dcc_fast_clear_size *
+                            num_layers;
        }
 
        rctx->clear_buffer(&rctx->b, dcc_buffer, dcc_offset, clear_size,