radv: allocate DCC metadata for each mip
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Jun 2019 12:52:28 +0000 (14:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Jun 2019 20:20:53 +0000 (22:20 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_image.c

index a74884f411bb79c5456df1b060e268be29d36858..98df24d3546e7f9b55002a704410c9abd2d6e175 100644 (file)
@@ -924,11 +924,11 @@ radv_image_alloc_dcc(struct radv_image *image)
        assert(image->plane_count == 1);
 
        image->dcc_offset = align64(image->size, image->planes[0].surface.dcc_alignment);
-       /* + 16 for storing the clear values + dcc pred */
+       /* + 24 for storing the clear values + fce pred + dcc pred for each mip */
        image->clear_value_offset = image->dcc_offset + image->planes[0].surface.dcc_size;
-       image->fce_pred_offset = image->clear_value_offset + 8;
-       image->dcc_pred_offset = image->clear_value_offset + 16;
-       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24;
+       image->fce_pred_offset = image->clear_value_offset + 8 * image->info.levels;
+       image->dcc_pred_offset = image->clear_value_offset + 16 * image->info.levels;
+       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24 * image->info.levels;
        image->alignment = MAX2(image->alignment, image->planes[0].surface.dcc_alignment);
 }