Mesa (main): radv: Use common DCC image store check

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Oct 2 23:21:41 UTC 2021


Module: Mesa
Branch: main
Commit: fccdebd64dc4b0a192f3b0fc9e7b642067952d28
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fccdebd64dc4b0a192f3b0fc9e7b642067952d28

Author: Joshua Ashton <joshua at froggi.es>
Date:   Fri Oct  1 22:52:36 2021 +0100

radv: Use common DCC image store check

We need to keep RADV and RadeonSI on the same page about this due to modifiers.

Signed-off-by: Joshua Ashton <joshua at froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13153>

---

 src/amd/vulkan/radv_image.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 57459a36727..05398b4ba4c 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -291,22 +291,8 @@ radv_use_dcc_for_image(struct radv_device *device, struct radv_image *image,
 bool
 radv_image_use_dcc_image_stores(const struct radv_device *device, const struct radv_image *image)
 {
-   /* DCC image stores is only available for GFX10+. */
-   if (device->physical_device->rad_info.chip_class < GFX10)
-      return false;
-
-   /* DCC image stores require the following settings:
-    * - INDEPENDENT_64B_BLOCKS = 0
-    * - INDEPENDENT_128B_BLOCKS = 1
-    * - MAX_COMPRESSED_BLOCK_SIZE = 128B
-    * - MAX_UNCOMPRESSED_BLOCK_SIZE = 256B (always used)
-    *
-    * The same limitations apply to SDMA compressed stores because
-    * SDMA uses the same DCC codec.
-    */
-   return !image->planes[0].surface.u.gfx9.color.dcc.independent_64B_blocks  &&
-           image->planes[0].surface.u.gfx9.color.dcc.independent_128B_blocks &&
-           image->planes[0].surface.u.gfx9.color.dcc.max_compressed_block_size == V_028C78_MAX_BLOCK_SIZE_128B;
+   return ac_surface_supports_dcc_image_stores(device->physical_device->rad_info.chip_class,
+                                               &image->planes[0].surface);
 }
 
 /*



More information about the mesa-commit mailing list