radv: always clear the FCE predicate after DCC/FMASK/CMASK decompressions
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 16 Nov 2018 12:40:10 +0000 (13:40 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 19 Nov 2018 13:05:35 +0000 (14:05 +0100)
DCC and FMASK also imply a fast-clear eliminate, so it should be
safe to reset the predicate unconditionally. We still only skip
FMASK or CMASK decompressions for now.

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

index 77fa4e2fa551614e92c3eb0f64129660b2901eae..a54b78c2a6c82bec11d0044b6eb0f3a96b8b41d0 100644 (file)
@@ -702,11 +702,6 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer,
 
                radv_emit_set_predication_state_from_image(cmd_buffer, image, false);
 
-               /* Clear the image's fast-clear eliminate predicate because
-                * FMASK and DCC also imply a fast-clear eliminate.
-                */
-               radv_update_fce_metadata(cmd_buffer, image, false);
-
                if (cmd_buffer->state.predication_type != -1) {
                        /* Restore previous conditional rendering user state. */
                        si_emit_set_predication_state(cmd_buffer,
@@ -714,6 +709,14 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer,
                                                      cmd_buffer->state.predication_va);
                }
        }
+
+       if (radv_image_has_dcc(image)) {
+               /* Clear the image's fast-clear eliminate predicate because
+                * FMASK and DCC also imply a fast-clear eliminate.
+                */
+               radv_update_fce_metadata(cmd_buffer, image, false);
+       }
+
        radv_meta_restore(&saved_state, cmd_buffer);
 }