intel/isl: Add a score for DG2_RC_CCS
authorNanley Chery <nanley.g.chery@intel.com>
Thu, 4 May 2023 20:36:55 +0000 (13:36 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 20 Jul 2023 20:53:27 +0000 (20:53 +0000)
This enables the DG2 render compression modifier in anv. When I tested
this against vkcube, I observed that the full resolve which happened at
the end of every frame was converted to a partial resolve, allowing the
framebuffer to retain compression.

According to Caleb Callaway's testing, enabling this modifier positively
impacts the FPS of the following game benchmarks:

 - Strange Brigade.vk-g6              +12.78%
 - Strange Brigade.dx12vk-g6          + 9.33%
 - Shadow of the Tomb Raider.vk-g6-lx + 2.37%
 - Dota 2 (replay Jul 2020).vk-g6     + 2.28%

Thanks to Felix Degrood for pointing out that Strange Brigade would
benefit from this optimization.

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

src/intel/isl/isl_drm.c

index 0520c0d..ea52dee 100644 (file)
@@ -219,6 +219,14 @@ isl_drm_modifier_get_score(const struct intel_device_info *devinfo,
          return 0;
 
       return 3;
+   case I915_FORMAT_MOD_4_TILED_DG2_RC_CCS:
+      if (!intel_device_info_is_dg2(devinfo))
+         return 0;
+
+      if (INTEL_DEBUG(DEBUG_NO_CCS))
+         return 0;
+
+      return 4;
    }
 }