From: Samuel Pitoiset Date: Mon, 12 Apr 2021 13:01:24 +0000 (+0200) Subject: radv: allow HTILE for very small images if VRS attachment is used X-Git-Tag: upstream/21.2.3~4884 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba7c510e1f1a06a55e7bb9355c2c3c78e408511f;p=platform%2Fupstream%2Fmesa.git 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: --- 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