Mesa (master): radv: add radv_htile_enabled() helper

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Fri Oct 6 07:50:13 UTC 2017


Module: Mesa
Branch: master
Commit: 507df359394a914040ebebe72901001f99c104df
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=507df359394a914040ebebe72901001f99c104df

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Oct  3 10:48:42 2017 +0200

radv: add radv_htile_enabled() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_device.c  | 5 ++---
 src/amd/vulkan/radv_private.h | 6 ++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 833f0eed13..73a7abed95 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -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 &&
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index c2d78a7e2c..2405d98339 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -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




More information about the mesa-commit mailing list