From ba7c510e1f1a06a55e7bb9355c2c3c78e408511f Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 12 Apr 2021 15:01:24 +0200 Subject: [PATCH] radv: allow HTILE for very small images if VRS attachment is used We need a HTILE buffer to store the VRS rates. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_image.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 13db821..7e47315 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -316,9 +316,15 @@ radv_use_htile_for_image(const struct radv_device *device, const struct radv_ima 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)); + /* Do not enable HTILE for very small images because it seems less performant but make sure it's + * allowed with VRS attachments because we need HTILE. + */ + if (image->info.width * image->info.height < 8 * 8 && + !(device->instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS) && + !device->attachment_vrs_enabled) + return false; + + return (image->info.levels == 1 || use_htile_for_mips) && !image->shareable; } static bool -- 2.7.4