Mesa (18.3): radv: do not always initialize HTILE in compressed state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 5 10:53:29 UTC 2019


Module: Mesa
Branch: 18.3
Commit: 9434f6b5daccb3a45ee4b9e00c9fac9b114cc8f7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9434f6b5daccb3a45ee4b9e00c9fac9b114cc8f7

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Mar 28 16:03:03 2019 +0100

radv: do not always initialize HTILE in compressed state

Especially when performing a transtion from UNDEFINED->GENERAL,
the driver shouldn't initialize HTILE metadata in compressed
state because it doesn't decompress when the src layout is
GENERAL.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110259
Fixes: 3a2e93147f7 ("radv: always initialize HTILE when the src layout is UNDEFINED")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
(cherry picked from commit 62a9d757e6074215c145c9637014d9acb16d865d)

---

 src/amd/vulkan/radv_cmd_buffer.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index e874489b109..24954a939f5 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -4246,8 +4246,14 @@ static void radv_handle_depth_image_transition(struct radv_cmd_buffer *cmd_buffe
 		return;
 
 	if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED) {
-		/* TODO: merge with the clear if applicable */
-		radv_initialize_htile(cmd_buffer, image, range, 0);
+		uint32_t clear_value = vk_format_is_stencil(image->vk_format) ? 0xfffff30f : 0xfffc000f;
+
+		if (radv_layout_is_htile_compressed(image, dst_layout,
+						    dst_queue_mask)) {
+			clear_value = 0;
+		}
+
+		radv_initialize_htile(cmd_buffer, image, range, clear_value);
 	} else if (!radv_layout_is_htile_compressed(image, src_layout, src_queue_mask) &&
 	           radv_layout_is_htile_compressed(image, dst_layout, dst_queue_mask)) {
 		uint32_t clear_value = vk_format_is_stencil(image->vk_format) ? 0xfffff30f : 0xfffc000f;




More information about the mesa-commit mailing list