Mesa (main): radv: allow fast clears for concurrent images if comp-to-single is supported

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 10 11:36:35 UTC 2021


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Jul 27 23:08:19 2021 +0200

radv: allow fast clears for concurrent images if comp-to-single is supported

Only GFX10+ is affected because older chips don't support
comp-to-single. For them, we need to implement FCE on compute with DCC
and eventually CMASK.

Fixes the gap between concurrent vs exclusive queue with Scarlet Nexus,
also gives a boost with Doom Eternal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12088>

---

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

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 66e187e75d2..32cef33f2d9 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -2068,8 +2068,14 @@ radv_layout_can_fast_clear(const struct radv_device *device, const struct radv_i
    if (!(image->usage & RADV_IMAGE_USAGE_WRITE_BITS))
       return false;
 
-   return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL &&
-          queue_mask == (1u << RADV_QUEUE_GENERAL);
+   if (layout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
+      return false;
+
+   /* Exclusive images with CMASK or DCC can always be fast-cleared on the gfx queue. Concurrent
+    * images can only be fast-cleared if comp-to-single is supported because we don't yet support
+    * FCE on the compute queue.
+    */
+   return queue_mask == (1u << RADV_QUEUE_GENERAL) || radv_image_use_comp_to_single(device, image);
 }
 
 bool



More information about the mesa-commit mailing list