radv: teach radv_htile_enabled() about the number of HTILE levels

This is the main function that enables/disables HTILE for mipmaps.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8124>
This commit is contained in:
Samuel Pitoiset 2020-12-16 09:48:11 +01:00
parent 13f34e65ba
commit 5417c6690e

View file

@ -2023,7 +2023,8 @@ radv_image_has_htile(const struct radv_image *image)
static inline bool
radv_htile_enabled(const struct radv_image *image, unsigned level)
{
return radv_image_has_htile(image) && level == 0;
return radv_image_has_htile(image) &&
level < image->planes[0].surface.num_htile_levels;
}
/**