From f4f096805b08c1f00e695569f2368b319cfcc256 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 10 Dec 2020 14:06:58 +0100 Subject: 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 Reviewed-by: Bas Nieuwenhuizen Part-of: --- 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; } -- cgit v1.2.3