radv: disable HTILE for very small depth surfaces
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 28 Sep 2018 14:28:50 +0000 (16:28 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 1 Oct 2018 08:16:33 +0000 (10:16 +0200)
Like we disable DCC/CMASK for small color surfaces as well.
Serious Sam 2017 creates a 1x1 depth surface and I think
it should be faster to do slow clears on the graphics queue
instead of fast clears on compute, and eventually a depth
expand if the surface isn't TC-compatible HTILE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_image.c

index b316242..65a62fb 100644 (file)
@@ -906,7 +906,9 @@ radv_image_can_enable_fmask(struct radv_image *image)
 static inline bool
 radv_image_can_enable_htile(struct radv_image *image)
 {
-       return image->info.levels == 1 && vk_format_is_depth(image->vk_format);
+       return image->info.levels == 1 &&
+              vk_format_is_depth(image->vk_format) &&
+              image->info.width * image->info.height >= 8 * 8;
 }
 
 VkResult