Mesa (master): radv: fix TC-compat HTILE images with DST_OPTIMAL on the compute queue

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 5 12:20:58 UTC 2021


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Dec 10 14:06:58 2020 +0100

radv: fix TC-compat HTILE images with DST_OPTIMAL on the compute queue

This is probably rare but can happen if someone performs a depth-stencil
copy on the compute queue. This might work (untested by CTS) but it
looks more conservative to decompress before perfoming the operation.

Found by inspection.

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/8039>

---

 src/amd/vulkan/radv_image.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index fe12a4e9fd8..4203f4262eb 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -1764,6 +1764,11 @@ bool radv_layout_is_htile_compressed(const struct radv_image *image,
 			return true;
 		}
 
+		if ((layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ||
+		     layout == VK_IMAGE_LAYOUT_GENERAL) &&
+		    (queue_mask & (1u << RADV_QUEUE_COMPUTE)))
+			return false;
+
 		return layout != VK_IMAGE_LAYOUT_GENERAL;
 	}
 



More information about the mesa-commit mailing list