radv: allocate CMASK for DCC fast clear with MSAA
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 17 Apr 2018 14:05:15 +0000 (16:05 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 19 Apr 2018 07:10:48 +0000 (09:10 +0200)
CMASK is required because it should be cleared to
0xCCCCCCCC for MSAA textures.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_image.c

index a14e7c18b294ff3fc831f96927620997430a5b85..ba8f14d91bd08322508a45731936227a33521404 100644 (file)
@@ -997,6 +997,13 @@ radv_image_create(VkDevice _device,
                /* Try to enable DCC first. */
                if (radv_image_can_enable_dcc(image)) {
                        radv_image_alloc_dcc(image);
+                       if (image->info.samples > 1) {
+                               /* CMASK should be enabled because DCC fast
+                                * clear with MSAA needs it.
+                                */
+                               assert(radv_image_can_enable_cmask(image));
+                               radv_image_alloc_cmask(device, image);
+                       }
                } else {
                        /* When DCC cannot be enabled, try CMASK. */
                        image->surface.dcc_size = 0;