From 25a32433b13a329e8e510ce6328fa92f35f244c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 11 Dec 2023 10:03:51 +0200 Subject: [PATCH] anv: use slow clear for small surfaces with Wa_18020603990 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Described in Wa_18020603990, we need to use slow clear or add an partial resolve after fast clear for surfaces where bpp <= 32 and dim <= 256x256. Signed-off-by: Tapani Pälli Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/anv_image.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 5ba57beebe9..5287b5bfeff 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -3269,6 +3269,16 @@ anv_can_fast_clear_color_view(struct anv_device *device, "LOAD_OP_CLEAR. Only fast-clearing the first slice"); } + /* Wa_18020603990 - slow clear surfaces up to 256x256, 32bpp. */ + if (intel_needs_workaround(device->info, 18020603990)) { + const struct anv_surface *anv_surf = + &iview->image->planes->primary_surface; + if (isl_format_get_layout(anv_surf->isl.format)->bpb <= 32 && + anv_surf->isl.logical_level0_px.w <= 256 && + anv_surf->isl.logical_level0_px.h <= 256) + return false; + } + return true; }