Mesa (master): radv: Do not consider layouts fast-clearable on compute queue.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 10 16:38:56 UTC 2020


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

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Thu Jul 30 12:21:01 2020 +0200

radv: Do not consider layouts fast-clearable on compute queue.

We cannot decompress from the compute queue. While I'm pretty sure
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL is only useful on the
graphics queue, I cannot find a VU that prevents the transition
from happening on another queue, so we need to be careful here.

This patch ensures we do the decompression on the barrier that changes
the queue ownership.

Another problem was that DCC images were considered fast-clearable
when not DCC compressed, which resulted in a mess with concurrent
queue ownership.

Cc: <mesa-stable at lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3387
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6252>

---

 src/amd/vulkan/radv_image.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 8671a6ffb77..7782e77d1fe 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -1712,7 +1712,8 @@ bool radv_layout_can_fast_clear(const struct radv_image *image,
 				bool in_render_loop,
 			        unsigned queue_mask)
 {
-	return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+	return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL &&
+	       queue_mask == (1u << RADV_QUEUE_GENERAL);
 }
 
 bool radv_layout_dcc_compressed(const struct radv_device *device,



More information about the mesa-commit mailing list