radv: add radv_htile_enabled() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 3 Oct 2017 08:48:42 +0000 (10:48 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Oct 2017 07:49:05 +0000 (09:49 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h

index 833f0eed135b478533469953a4dafb98e8c48728..73a7abed95371365e69daf277f43c3fa129e5d71 100644 (file)
@@ -3255,8 +3255,7 @@ radv_initialise_ds_surface(struct radv_device *device,
                ds->db_depth_size = S_02801C_X_MAX(iview->image->info.width - 1) |
                        S_02801C_Y_MAX(iview->image->info.height - 1);
 
-               /* Only use HTILE for the first level. */
-               if (iview->image->surface.htile_size && !level) {
+               if (radv_htile_enabled(iview->image, level)) {
                        ds->db_z_info |= S_028038_TILE_SURFACE_ENABLE(1);
 
                        if (iview->image->tc_compatible_htile) {
@@ -3331,7 +3330,7 @@ radv_initialise_ds_surface(struct radv_device *device,
                        S_028058_HEIGHT_TILE_MAX((level_info->nblk_y / 8) - 1);
                ds->db_depth_slice = S_02805C_SLICE_TILE_MAX((level_info->nblk_x * level_info->nblk_y) / 64 - 1);
 
-               if (iview->image->surface.htile_size && !level) {
+               if (radv_htile_enabled(iview->image, level)) {
                        ds->db_z_info |= S_028040_TILE_SURFACE_ENABLE(1);
 
                        if (!iview->image->surface.has_stencil &&
index c2d78a7e2c7bb87e1c11e91c5d0e802e66bb4f45..2405d983394ddeb6607f8b296b408d157be9fef0 100644 (file)
@@ -1253,6 +1253,12 @@ radv_vi_dcc_enabled(const struct radv_image *image, unsigned level)
        return image->surface.dcc_size && level < image->surface.num_dcc_levels;
 }
 
+static inline bool
+radv_htile_enabled(const struct radv_image *image, unsigned level)
+{
+       return image->surface.htile_size && level == 0;
+}
+
 unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t family, uint32_t queue_family);
 
 static inline uint32_t