anv/cmd_buffer: Warn about not enabling CCS_E
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 28 Jun 2017 17:29:04 +0000 (10:29 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sun, 23 Jul 2017 03:12:10 +0000 (20:12 -0700)
Use the performance warning infrastructure to provide helpful
information when testing applications.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_cmd_buffer.c

index 36c56691521d58109833ee69049e8ca6868612e8..770f92cb2197a0d23aa66f718a76decb50f1194c 100644 (file)
@@ -270,16 +270,18 @@ color_attachment_compute_aux_usage(struct anv_device * device,
        * also supports color compression.
        */
       if (isl_format_supports_ccs_e(&device->info, iview->isl.format)) {
-         /* TODO: Consider using a heuristic to determine if temporarily enabling
-          * CCS_E for this image view would be beneficial.
-          *
-          * While fast-clear resolves and partial resolves are fairly cheap in the
+         att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D;
+
+         /* While fast-clear resolves and partial resolves are fairly cheap in the
           * case where you render to most of the pixels, full resolves are not
           * because they potentially involve reading and writing the entire
           * framebuffer.  If we can't texture with CCS_E, we should leave it off and
           * limit ourselves to fast clears.
           */
-         att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D;
+         if (cmd_state->pass->attachments[att].first_subpass_layout ==
+             VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) {
+            anv_perf_warn("Not temporarily enabling CCS_E.");
+         }
       } else {
          att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
       }