From cea75b3d95d5ded9e41b1f0c4450381e69631267 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 10 Mar 2026 10:42:50 +0100 Subject: [PATCH] radv: only consider HiZ as valid after clears with the depth aspect If it's a stencil-only clear it shouldn't be marked as valid because HiZ wasn't updated by the clear. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/meta/radv_meta_clear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/meta/radv_meta_clear.c b/src/amd/vulkan/meta/radv_meta_clear.c index 6514bc47298..7243e4e45af 100644 --- a/src/amd/vulkan/meta/radv_meta_clear.c +++ b/src/amd/vulkan/meta/radv_meta_clear.c @@ -542,7 +542,8 @@ emit_depthstencil_clear(struct radv_cmd_buffer *cmd_buffer, VkClearDepthStencilV enum radv_cmd_flush_bits flush_bits = radv_clear_hiz(cmd_buffer, iview->image, &range, radv_gfx12_get_hiz_initial_value()); - radv_update_hiz_metadata(cmd_buffer, iview->image, &range, true); + if (aspects & VK_IMAGE_ASPECT_DEPTH_BIT) + radv_update_hiz_metadata(cmd_buffer, iview->image, &range, true); if (post_flush) *post_flush |= flush_bits;