Mesa (master): radv: enable TC-compat HTILE for mipmaps on GFX10+
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 27 08:49:32 UTC 2021
Module: Mesa
Branch: master
Commit: 741c0b160563f8afe87654291d41e6cbebb9d8b5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=741c0b160563f8afe87654291d41e6cbebb9d8b5
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Wed Dec 16 09:58:52 2020 +0100
radv: enable TC-compat HTILE for mipmaps on GFX10+
Mipmaps+layers should be investigated and mipmaps support added
for previous gens (GFX8-9).
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/8124>
---
src/amd/vulkan/radv_image.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index a69f6d09864..0229db314c0 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -82,7 +82,9 @@ radv_use_tc_compat_htile_for_image(struct radv_device *device,
if (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR)
return false;
- if (pCreateInfo->mipLevels > 1)
+ if (pCreateInfo->mipLevels > 1 &&
+ (device->physical_device->rad_info.chip_class < GFX10 ||
+ pCreateInfo->arrayLayers > 1))
return false;
/* Do not enable TC-compatible HTILE if the image isn't readable by a
@@ -249,8 +251,15 @@ static inline bool
radv_use_htile_for_image(const struct radv_device *device,
const struct radv_image *image)
{
- return image->info.levels == 1 &&
- !image->shareable &&
+ /* TODO:
+ * - Investigate about mips+layers.
+ * - Enable on other gens.
+ */
+ bool use_htile_for_mips = image->info.array_size == 1 &&
+ device->physical_device->rad_info.chip_class >= GFX10;
+
+ return (image->info.levels == 1 || use_htile_for_mips) &&
+ !image->shareable &&
((image->info.width * image->info.height >= 8 * 8) ||
(device->instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS));
}
More information about the mesa-commit
mailing list