From: Marek Olšák Date: Tue, 28 Nov 2017 19:57:10 +0000 (+0100) Subject: radeonsi: fix layered DCC fast clear X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6863651bbdd7dcfad60bae78d1e17898f49ca08b;p=mesa.git radeonsi: fix layered DCC fast clear Cc: 17.2 17.3 Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 3fa5f5eaa97..933a4a9bbe9 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -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,