summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2020-12-10 14:06:58 +0100
committerMarge Bot <eric+marge@anholt.net>2021-01-05 12:10:11 +0000
commitf4f096805b08c1f00e695569f2368b319cfcc256 (patch)
treef104ca31906c6d2016720959ff16f31b143d39d2
parent1c539b64846de06c1f54183fca46178b0a91553e (diff)
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@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039>
-rw-r--r--src/amd/vulkan/radv_image.c5
1 files changed, 5 insertions, 0 deletions
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;
}