Mesa (master): radv: only enable TC-compat HTILE for images readable by a shader
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 9 12:08:07 UTC 2020
Module: Mesa
Branch: master
Commit: 4de84c8cbd6f6fe46703a3a8d5283460bbeb50fc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4de84c8cbd6f6fe46703a3a8d5283460bbeb50fc
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Tue Mar 31 10:35:00 2020 +0200
radv: only enable TC-compat HTILE for images readable by a shader
If no texture fetches happen it's useless to enable TC-compat HTILE.
Because the driver currently doesn't support TC-compat HTILE for
storage images we don't have to check.
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/4497>
---
src/amd/vulkan/radv_image.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index bdd62a9cbf4..cf35855dfee 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -81,6 +81,14 @@ radv_use_tc_compat_htile_for_image(struct radv_device *device,
if (pCreateInfo->mipLevels > 1)
return false;
+ /* Do not enable TC-compatible HTILE if the image isn't readable by a
+ * shader because no texture fetches will happen.
+ */
+ if (!(pCreateInfo->usage & (VK_IMAGE_USAGE_SAMPLED_BIT |
+ VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT |
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT)))
+ return false;
+
/* FIXME: for some reason TC compat with 2/4/8 samples breaks some cts
* tests - disable for now. On GFX10 D32_SFLOAT is affected as well.
*/
More information about the mesa-commit
mailing list