From dcfa351af30e2909c0adfdd4305cc5dec1c23a91 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 23 May 2024 13:53:29 +0200 Subject: [PATCH] radv: only enable DB_STENCIL_INFO.ITERATE_FLUSH when necessary When no HTILE for stencil this shouldn't be neessary. This also matches RadeonSI. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 0fb80e69615..347016a550a 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1912,10 +1912,11 @@ radv_initialise_ds_surface(const struct radv_device *device, struct radv_ds_buff ds->ac.db_z_info |= S_028038_DECOMPRESS_ON_N_ZPLANES(max_zplanes); if (pdev->info.gfx_level >= GFX10) { + const bool htile_stencil_disabled = radv_image_tile_stencil_disabled(device, iview->image); bool iterate256 = radv_image_get_iterate256(device, iview->image); ds->ac.db_z_info |= S_028040_ITERATE_FLUSH(1); - ds->ac.db_stencil_info |= S_028044_ITERATE_FLUSH(1); + ds->ac.db_stencil_info |= S_028044_ITERATE_FLUSH(!htile_stencil_disabled); ds->ac.db_z_info |= S_028040_ITERATE_256(iterate256); ds->ac.db_stencil_info |= S_028044_ITERATE_256(iterate256); } else {