From 96403c1ec4ab14f65cdbda30adb4b6caa1071db0 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 27 Jul 2021 23:08:19 +0200 Subject: [PATCH] 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 Reviewed-by: Bas Nieuwenhuizen Part-of: --- 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