radv: initialize the DCC predicate correctly when it's compressed
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 16 Aug 2018 10:33:13 +0000 (12:33 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 16 Aug 2018 12:11:51 +0000 (14:11 +0200)
We have to do a fast-clear eliminate when clearing DCC
metadata with 0x20202020. I don't know if that fixes anything
but that seems correct to me.

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 84f7bb42c451c7f67d790976f470cd08c7e4e4ee..52c943f302a760cde913dfae8ea8e2613b47073d 100644 (file)
@@ -4127,15 +4127,18 @@ static void radv_init_color_image_metadata(struct radv_cmd_buffer *cmd_buffer,
 
        if (radv_image_has_dcc(image)) {
                uint32_t value = 0xffffffffu; /* Fully expanded mode. */
+               bool need_decompress_pass = false;
 
                if (radv_layout_dcc_compressed(image, dst_layout,
                                               dst_queue_mask)) {
                        value = 0x20202020u;
+                       need_decompress_pass = true;
                }
 
                radv_initialize_dcc(cmd_buffer, image, value);
 
-               radv_set_dcc_need_cmask_elim_pred(cmd_buffer, image, false);
+               radv_set_dcc_need_cmask_elim_pred(cmd_buffer, image,
+                                                 need_decompress_pass);
        }
 
        if (radv_image_has_cmask(image) || radv_image_has_dcc(image)) {