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@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12088>
This commit is contained in:
Samuel Pitoiset
2021-07-27 23:08:19 +02:00
parent bdae3c366e
commit 96403c1ec4

View File

@@ -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