Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
for (unsigned i = 0; i < image->planes[0].surface.num_dcc_levels; i++) {
struct legacy_surf_level *surf_level =
&image->planes[0].surface.u.legacy.level[i];
+ unsigned dcc_fast_clear_size =
+ surf_level->dcc_slice_fast_clear_size * image->info.array_size;
- if (!surf_level->dcc_fast_clear_size)
+ if (!dcc_fast_clear_size)
break;
- size = surf_level->dcc_offset + surf_level->dcc_fast_clear_size;
+ size = surf_level->dcc_offset + dcc_fast_clear_size;
}
/* Initialize the mipmap levels without DCC. */
* fast clear path fallbacks to slow clears if one
* level can't be fast cleared.
*/
- offset += surf_level->dcc_offset;
- size = surf_level->dcc_fast_clear_size;
+ offset += surf_level->dcc_offset +
+ surf_level->dcc_slice_fast_clear_size * range->baseArrayLayer;
+ size = surf_level->dcc_slice_fast_clear_size * radv_get_layerCount(image, range);
}
flush_bits |= radv_fill_buffer(cmd_buffer, image->bo, offset,