intel/blorp: Add depth usage check for copy format
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 8 May 2023 22:25:12 +0000 (15:25 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 22 May 2023 22:20:58 +0000 (22:20 +0000)
We will soon update the CCS_E aux-usage check to a CCS_E format check.
Since depth formats support CCS_E on gfx12+, add another check for the
depth usage to prevent depth surfaces from falling into the CCS_E copy
format case.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23087>

src/intel/blorp/blorp_blit.c

index be83bfa..f862b0e 100644 (file)
@@ -2925,6 +2925,12 @@ blorp_copy(struct blorp_batch *batch,
        */
       params.src.view.format = params.dst.surf.format;
       params.dst.view.format = params.dst.surf.format;
+   } else if (isl_surf_usage_is_depth(params.src.surf.usage) ||
+              isl_surf_usage_is_depth(params.dst.surf.usage)) {
+      assert(src_fmtl->bpb == dst_fmtl->bpb);
+      params.src.view.format =
+      params.dst.view.format =
+         get_copy_format_for_bpb(isl_dev, dst_fmtl->bpb);
    } else if (params.dst.aux_usage == ISL_AUX_USAGE_CCS_E ||
               params.dst.aux_usage == ISL_AUX_USAGE_GFX12_CCS_E) {
       params.dst.view.format = get_ccs_compatible_copy_format(dst_fmtl);